Guide to Indexing Event and Place Pages from DXP Modules in WordPress

Created by ITI Digital Support Digital, Modified on Fri, 6 Jun at 11:33 AM by Evan Kenepp

✅ WordPress | Guide to Indexing Event and Place Pages from DXP Modules in WordPress)

This guide will help you display dynamic event and place URLs on a WordPress page and ensure they can be discovered and indexed by Google.


Step 1: Find Out Which Theme is Active (Required for Later Steps)

Before modifying theme files, you need to know which WordPress theme your site is using.

  1. Log in to your WordPress Admin Dashboard.

  2. In the left-hand menu, go to:
    Appearance > Themes

  3. You'll see a list of installed themes.
    The one labeled “Active” is your current theme.

  4. Note down the theme name exactly — you’ll need it in upcoming steps when accessing files like header.php and functions.php.


Step 2: Create a Custom Template File in WordPress

1. Access Your WordPress Files

You can do this in one of two ways:

  • Through your hosting provider's File Manager (e.g., cPanel)

  • Or by connecting with FTP software like FileZilla

2. Go to the Active Theme Folder

Navigate to:

/wp-content/themes/YOUR-ACTIVE-THEME-NAME/

Replace YOUR-ACTIVE-THEME-NAME with the name you found in Step 1 (e.g., astra, twentytwentytwo).

3. Create a New File

  • Name the file: page-api-data.php

4. Paste the Following Code into the File

  • Replace 'YourDXPAccountName' in the code with the Hub name identified in your module embed code (it is typically your city name and two letter state abbreviation).
<?php /**  * Template Name: API Data Template  * This shows a list of events and places from an API.  */ get_header(); ?> <div id="content" class="site-content">     <h1>Events</h1>     <div id="eventsContainer"></div>     <h1>Places</h1>     <div id="placesContainer"></div> </div> <script type="text/javascript"> jQuery(document).ready(function($) {     var apiEndpoint = 'https://imgoing-prod-api.xyz/api/visitors/YourDXPAccountName/ig-links-for-seo';     $.getJSON(apiEndpoint)         .done(function(data) {             if (data.eventUrls && data.eventUrls.length) {                 data.eventUrls.forEach(function(url) {                     $('#eventsContainer').append(`<a href="${url}">${url}</a><br/>`);                 });             } else {                 $('#eventsContainer').html('<p>No event URLs found.</p>');             }             if (data.placeUrls && data.placeUrls.length) {                 data.placeUrls.forEach(function(url) {                     $('#placesContainer').append(`<a href="${url}">${url}</a><br/>`);                 });             } else {                 $('#placesContainer').html('<p>No place URLs found.</p>');             }         })         .fail(function() {             console.error('Error loading API data.');         }); }); </script> <?php get_footer(); ?>

Save the file once you've pasted the code.


 Step 3: Create a New Page in WordPress

  1. Go to your WordPress Admin Dashboard.

  2. Navigate to:
    Pages > Add New

  3. Add a title:
    Imgoing Page XML

  4. The page URL (slug) will automatically be:
    https://yourwebsite.com/imgoing-page-xml/
    (If not, edit the URL under “Permalink”)

  5. Click Publish.

 


 Step 4: Assign the Custom Template to the Page

  1. Go to Pages > All Pages.

  2. Find and edit the page you just created: Imgoing Page XML

  3. On the right-hand sidebar, find Page Attributes.

  4. Under Template, select:
    API Data Template

    Open image-20250415-143142.png
  5. Click Update/Save.

 


 Step 5: Confirm That the Page Is Working

  1. Visit the page URL:

    https://yourwebsite.com/imgoing-page-xml/

  2. You should see:

    • A section for Events and one for Places

    • If everything is working, links will appear in 3–5 seconds.

    • If no data is found, it will display “No event/place URLs found.”

    • If you6 website has only Events module then only events URLs will be displayed and vice versa. 

 


 Step 6: Allow Search Engines to Crawl These Pages

  1. Using File Manager or FTP, go to your site’s root folder:

    /public_html/
  2. Look for a file named robots.txt.

    • If it doesn’t exist, create one.

  3. Add this code to the file:

    Allow: /*?imgoing-event= Allow: /*?imgoing-place=
  4. Save the file.

 


 Step 7: Add a Script to Help Google "See" Dynamic Content

  1. In File Manager or FTP, go to:

    /wp-content/themes/YOUR-ACTIVE-THEME-NAME/
  2. Open the file: header.php

  3. Inside the <head> section (near the top), paste this line

    • Replace 'YourDXPAccountName' in the code with the Hub name identified in your module embed code (it is typically your city name and two letter state abbreviation).
<script src="https://next.imgoingcalendar.com/imgoing-prerender.js?hubName=YourDXPAccountName"></script>

Save and close the file.

 


⚠️ Step 8: Disable Canonical Tags on Specific Pages

This prevents search engines from ignoring your dynamic content.

  1. In File Manager or FTP, go to:

    /wp-content/themes/YOUR-ACTIVE-THEME-NAME/
  2. Open the file: functions.php

Scroll to the very bottom and paste this code

The section '$target_slugs' must be updated to reflect the page URLs containing embedded ITI modules on your site. In this example, 'calendar' and 'places-to-stay' represent a URL slug like www.yourwebsite.com/calendar/ and www.yourwebsite.com/places-to-stay/.

Important:

  • If an 'All Events' or 'All Places' module is embedded on your site, then only the page slugs of these pages need to be added to the script. No pages with embedded category or subcategory modules need to be added.
  • If multiple 'All Events' or 'All Places' modules are embedded on different pages, only one URL slug needs to be added to the script, from any one of these pages.
  • If there are only custom category or subcategory modules embedded on the site, then each page slug containing a module will need to be added to the script.
    • If a primary category is embedded on a page, and subcategories of the primary are embedded on other pages, only the primary category page slug needs to be added to the script.
add_action('template_redirect', 'remove_canonical_tag_by_slug'); function remove_canonical_tag_by_slug() {     // Define the slugs of pages or posts where canonical tag should be removed     $target_slugs = array('calendar', 'places-to-stay');     // Get the current post safely (works with pages, posts, and custom post types)     $post = get_queried_object();     // Make sure it's a singular post/page and the post object exists     if (is_singular() && isset($post->post_name) && in_array($post->post_name, $target_slugs)) {         ob_start(function($buffer) {             // Remove any <link rel="canonical"> tag             return preg_replace('/<link\s+rel=["\']canonical["\'].*?>\s*/i', '', $buffer);         });     } }
  1. Click Save Changes.


 Step 9: Verify Your Page Appears in the Sitemap

If you're using an SEO plugin (like Yoast SEO or RankMath):

  1. Visit your sitemap URL:

    https://yourwebsite.com/sitemap.xml
  2. Click on the Pages sitemap.

  3. Look for: Imgoing Page XML — it should be listed.

If it's NOT visible:

  • Regenerate your sitemap from the SEO plugin’s settings.

  • Then resubmit it in Google Search Console under Sitemaps.





Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article