CMS Development

wmflan39
Contributor

Duplicated dynamic child page URLs in sitemap.xml

SOLVE

I have 10 parent URLs (ex: .../brazing-collection/...), each of which has a group of child pages dynamically rendered with a dynamic template from data in a HubDB table. The website pages work as expected but...

 

Looking at my sitemap.xml file: each of my dynamic child URLs is present for the correct parent URL, but also for each of the 9 other parent URLs. This is weird and it's also messing with my indexed pages listing on GSC, since some of these false URLs are being referred to the Google index by the sitemap.xml file.

 

Examples:

 

The correct URL appears in sitemap.xml:

https://www.ambrell.com/induction-heating-applications/brazing-collection/brazing-steel-collar-and-i...

But the URL also appears in sitemap.xml under each of my 9 other ...-collection/... parent pages (2 examples):

https://www.ambrell.com/induction-heating-applications/soldering-collection/brazing-steel-collar-and...

https://www.ambrell.com/induction-heating-applications/heating-collection/brazing-steel-collar-and-i...

 

Can you help me figure out why this happens and what I can do about it, please?

1 Accepted solution
GRajput
Solution
Recognized Expert | Gold Partner
Recognized Expert | Gold Partner

Duplicated dynamic child page URLs in sitemap.xml

SOLVE

Hi @wmflan39 

 

This is a pretty common (and frustrating) issue when working with HubSpot’s dynamic pages, especially if you’re using HubDB to generate them. Don’t worry — I’ll walk you through why this is happening and what you can do to fix it.

Why This Is Happening:

  1. One template, many parent paths (collections)

 You’re using one dynamic page template that pulls content from a HubDB table. Ideally, each item in the table (like a specific brazing application) should only appear under one collection (like /brazing-collection/).

 But HubSpot doesn’t automatically enforce that. So, if your setup isn’t carefully structured, the same page (like brazing-steel-collar-and-inductor) ends up being accessible under other collections too (like /soldering-collection/), even though that doesn’t make sense.

  1. Flexible URL routing = accidental duplicates

 HubSpot’s dynamic page system is flexible. That’s great, but it also means that unless you’ve set up very specific logic, each item in your HubDB table might be available under any of your parent collection URLs.

  1. HubSpot’s sitemap includes anything “reachable”

 If a URL works — even if it’s not correct — HubSpot adds it to your sitemap. That’s why all those incorrect URLs are showing up in your sitemap.xml and getting indexed by Google.

What You Can Do About It:

You need to make sure each dynamic page:

Has only one valid, correct URL, and

Isn’t accidentally accessible under the wrong parent paths.

 

Here’s how to fix that:

  1. Set Up Canonical URLs (most important for SEO)

Tell search engines which version of each page is the official one.

In your HubDB table, add a column called something like canonical_url, and fill it with the correct full URL for each row (e.g., /brazing-collection/brazing-steel-collar-and-inductor).

Then, in your dynamic page settings, make sure HubSpot uses that column as the Canonical URL field.

This adds a <link rel="canonical" href="..."> tag to each page’s <head>, helping Google know which URL to trust and ignore the duplicates.

  1. Fix Your Dynamic Page Routing (very important)

You need to make sure that each item in your HubDB table is only accessible through its proper collection route.

You likely have one of two setups:

  1. One dynamic page handles all collections (recommended)

If all your collection types (brazing, soldering, etc.) are in one HubDB table:

Your URL pattern should look like:

 /induction-heating-applications/:collection-type/:slug

Add a collection-type column in your HubDB table (e.g., brazing-collection)

Use logic in your template like this:

{% set path_parts = request.path|split('/') %}
{% set collection = path_parts[3] %}

{% for row in hubdb_table_rows(123456) %}
  {% if row.collection_type == collection %}
    {# Render this row's content only if the collection matches #}
  {% endif %}
{% endfor %}

 

This ensures a brazing page won’t render under soldering URLs.

You have multiple dynamic pages for different collections using the same HubDB

This creates duplicates — don’t do this unless each collection pulls from a separate HubDB table. If they all use the same table, stick to a single dynamic page with filtering logic as shown above.

  1. Optional: Use Robots.txt to Block Bad URLs

This is a backup option, not a real fix.

You can block the bad URLs from being crawled by search engines via robots.txt, but this doesn’t stop them from being indexed if Google finds them elsewhere.

  1. Temporarily Remove the Bad URLs from Google

If wrong URLs are already in Google’s index, go to Google Search Console > Removals and request to temporarily remove them.

This clears them out faster, but won’t stop them from coming back unless you fix the routing and canonical issues above.

Checklist:

  • Make routing and canonical updates as above.
  • Test everything: Make sure incorrect URLs return a 404 or don’t show content.
  • Resubmit your sitemap in Google Search Console.
  • Monitor GSC to confirm that:
  • Bad URLs are being deindexed
  • The correct ones are being prioritized



Gaurav Rajput
Director, MarTech( Growth Natives)

Book a meeting


View solution in original post

0 Upvotes
2 Replies 2
GRajput
Solution
Recognized Expert | Gold Partner
Recognized Expert | Gold Partner

Duplicated dynamic child page URLs in sitemap.xml

SOLVE

Hi @wmflan39 

 

This is a pretty common (and frustrating) issue when working with HubSpot’s dynamic pages, especially if you’re using HubDB to generate them. Don’t worry — I’ll walk you through why this is happening and what you can do to fix it.

Why This Is Happening:

  1. One template, many parent paths (collections)

 You’re using one dynamic page template that pulls content from a HubDB table. Ideally, each item in the table (like a specific brazing application) should only appear under one collection (like /brazing-collection/).

 But HubSpot doesn’t automatically enforce that. So, if your setup isn’t carefully structured, the same page (like brazing-steel-collar-and-inductor) ends up being accessible under other collections too (like /soldering-collection/), even though that doesn’t make sense.

  1. Flexible URL routing = accidental duplicates

 HubSpot’s dynamic page system is flexible. That’s great, but it also means that unless you’ve set up very specific logic, each item in your HubDB table might be available under any of your parent collection URLs.

  1. HubSpot’s sitemap includes anything “reachable”

 If a URL works — even if it’s not correct — HubSpot adds it to your sitemap. That’s why all those incorrect URLs are showing up in your sitemap.xml and getting indexed by Google.

What You Can Do About It:

You need to make sure each dynamic page:

Has only one valid, correct URL, and

Isn’t accidentally accessible under the wrong parent paths.

 

Here’s how to fix that:

  1. Set Up Canonical URLs (most important for SEO)

Tell search engines which version of each page is the official one.

In your HubDB table, add a column called something like canonical_url, and fill it with the correct full URL for each row (e.g., /brazing-collection/brazing-steel-collar-and-inductor).

Then, in your dynamic page settings, make sure HubSpot uses that column as the Canonical URL field.

This adds a <link rel="canonical" href="..."> tag to each page’s <head>, helping Google know which URL to trust and ignore the duplicates.

  1. Fix Your Dynamic Page Routing (very important)

You need to make sure that each item in your HubDB table is only accessible through its proper collection route.

You likely have one of two setups:

  1. One dynamic page handles all collections (recommended)

If all your collection types (brazing, soldering, etc.) are in one HubDB table:

Your URL pattern should look like:

 /induction-heating-applications/:collection-type/:slug

Add a collection-type column in your HubDB table (e.g., brazing-collection)

Use logic in your template like this:

{% set path_parts = request.path|split('/') %}
{% set collection = path_parts[3] %}

{% for row in hubdb_table_rows(123456) %}
  {% if row.collection_type == collection %}
    {# Render this row's content only if the collection matches #}
  {% endif %}
{% endfor %}

 

This ensures a brazing page won’t render under soldering URLs.

You have multiple dynamic pages for different collections using the same HubDB

This creates duplicates — don’t do this unless each collection pulls from a separate HubDB table. If they all use the same table, stick to a single dynamic page with filtering logic as shown above.

  1. Optional: Use Robots.txt to Block Bad URLs

This is a backup option, not a real fix.

You can block the bad URLs from being crawled by search engines via robots.txt, but this doesn’t stop them from being indexed if Google finds them elsewhere.

  1. Temporarily Remove the Bad URLs from Google

If wrong URLs are already in Google’s index, go to Google Search Console > Removals and request to temporarily remove them.

This clears them out faster, but won’t stop them from coming back unless you fix the routing and canonical issues above.

Checklist:

  • Make routing and canonical updates as above.
  • Test everything: Make sure incorrect URLs return a 404 or don’t show content.
  • Resubmit your sitemap in Google Search Console.
  • Monitor GSC to confirm that:
  • Bad URLs are being deindexed
  • The correct ones are being prioritized



Gaurav Rajput
Director, MarTech( Growth Natives)

Book a meeting


0 Upvotes
wmflan39
Contributor

Duplicated dynamic child page URLs in sitemap.xml

SOLVE

Many, many thanks @GRajput !

For your timely, thoughful and thorough response!

I asked the developer of our HubSPot theme to design this dynamic pages scheme (my skills pretty much stop at html+css).

It appears the cacnonical URL information has been set correctly:

2025-06-12_08-37-57.jpg

 I will share your post with the developer to handle the 'Fix Your Dynamic Page Routing' for a single template page and a single HubDB table.

Again, thanks very much for taking the time and brain cycles to review and to suggest a solution. This speaks very highly of your agency.