Bing duplicate URL remediation workflows

Fix duplicate URLs in headless and JavaScript sites

Use 3 controls—redirects, internal links, and canonical tags—to fix duplicate URLs in headless and JavaScript-rendered sites without creating new…

Fix duplicate URLs in headless and JavaScript sites

Last updated: December 01, 2026

Quick Answer: Use 3 controls—redirects, internal links, and canonical tags—to fix duplicate URLs in headless and JavaScript-rendered sites without creating new variants. Fix the rendered site architecture first: make one URL map to one rendered HTML response, then make client-side routing and URL state follow that same map. The topic is how to fix duplicate URLs in headless and JavaScript-rendered sites without creating new variants. The usual cause is not Bing “seeing too much”; it is a JavaScript app or headless CMS exposing several URL forms for the same page, such as trailing slashes, query-state URLs, and router-generated duplicates. For the underlying browser rules, see the WHATWG URL Standard, MDN History API, and Google Search Central on consolidating duplicate URLs. If the duplicate pattern is complex, consider consulting a technical SEO professional.

Key takeaways

  • Treat the rendered HTML URL as the source of truth, then make the app follow it, and consult a technical SEO professional if the rules are unclear.
  • Do not let router state, filters, or hydration create extra crawlable URLs by accident.
  • Fix the easiest duplicate source first: links, redirects, and canonical tags.
  • Keep one rule for each content type, or the site will keep generating new variants.
  • Stop after the routing layer if the problem is already caused by a template or CMS rule; do not add more rewrite logic than you need.

Why headless and JavaScript sites create duplicates

Duplicate URLs come from the same content being reachable through more than one address, and headless and JavaScript-rendered sites make that easy to do. A single article can be exposed as /page, /page/, /page?ref=home, /page#tab=2, and a router-generated path that points to the same rendered HTML.

The common trap is that the app and the crawler see different things. A client-side router may change the browser URL after load, while the server still returns the same rendered HTML for several paths. If hydration then rewrites links or state again, the site can produce another variant without anyone noticing.

This is why the fix has to start with the rendered site architecture, not with Bing. The crawler is usually following the links and URLs the app itself publishes. If the app emits 10 versions of one page, any indexer can end up with 10 entries.

A useful way to think about it is simple: one document, one URL, one canonical path. The URL Standard at the WHATWG and the History API guidance on MDN both exist for a reason. They give the browser rules for what changes in the address bar, but they do not stop a site from creating duplicate paths on its own.

What should the URL rule be?

The URL rule should be: every content page has one preferred path, and everything else resolves to it or stays out of crawlable space. That rule needs to cover slash style, query state, and route aliases before it covers anything fancy.

This is the point where many fixes go wrong. People add a canonical tag but leave the app free to generate the same page at /product, /product/, /product?variant=blue, and /product?sort=popular. Canonicals help, but they do not clean up a routing system that keeps minting new URLs.

Use a simple decision table before changing code:

URL form Keep, redirect, or block Why it matters
Preferred content path Keep This is the one URL that should rank and be linked everywhere
Slash or no-slash twin Redirect Two paths for one page split discovery and signals
Query-state URL for filters or tabs Usually block or keep out of crawlable links These often create endless variants
Router alias or legacy path Redirect Old paths should not compete with the current one
Hash-only state Usually keep out of indexable links It changes view state, not document identity
Comparison table of What should the URL rule be?
Comparison table: What should the URL rule be?

This is also the right place to decide who is not a fit for the fix. If a site truly needs many crawlable variants because each one is a distinct page with distinct content, then collapsing them into one URL is the wrong move. That is a content model problem, not a duplicate URL problem.

How do I fix duplicate URLs in a JavaScript app?

You fix duplicate URLs in a JavaScript app by making the router, links, and server agree on one path before you touch canonical tags. The safest practical order is usually to remove extra URL creation at the source, not to hide it later.

  1. Pick one preferred path for each page type.
    Decide whether /about or /about/ is the only valid form, and apply that rule sitewide where it matches the site’s content model. The result should be a single route pattern for each content type, not a case-by-case habit.

  2. Normalize internal links in templates and components.
    Check navigation, cards, breadcrumbs, pagination, and any button that uses pushState() or router links. When every internal link uses the preferred form, the site stops spreading duplicate paths through its own UI.

  3. Make the server return one response for each non-preferred URL.
    Old paths, slash variants, and legacy aliases should point to the preferred path with a redirect, not a second rendered page. This keeps rendered HTML from being duplicated under multiple addresses.

  4. Keep URL state out of the index unless it changes the page’s identity.
    Filters, sort order, open panels, and tab state are often better kept in memory or in a non-indexed pattern. If the state is only changing the view, not the content, it should not become a crawl target.

  5. Set the canonical URL in the rendered HTML, not only in JavaScript.
    The final HTML should already contain the preferred canonical path. If the app adds the tag later during hydration, some crawlers and validators will see the wrong version first.

  6. Stop router components from rewriting history twice.
    Some apps call pushState() on load, then hydrate and call it again after state settles. That can create two visible URLs for one page in a single visit. One route change should be enough.

  7. Check for pagination and filter combinations that explode into variants.
    A product grid with 5 filters and 4 sort options can create a large set of address combinations. Limit which combinations are linkable, and keep the rest out of the crawl path.

The rule of thumb is this: if removing the JavaScript app still leaves the URL structure understandable, you are close. If the URL only makes sense after the client has rewritten it, the architecture is still too fragile.

How do I keep hydration from creating new variants?

You keep hydration from creating new variants by making the first rendered HTML and the hydrated app agree on the same canonical URL, link set, and state model. Hydration should confirm the page, not rename it.

The most common hydration problem is mismatch between what the server renders and what the client thinks the URL should be. A headless CMS might send one path in the HTML, while the JavaScript app reads a different router state after load and swaps the address or link targets. That makes duplicate URL variants more likely because the same page is now published in two forms.

The fix is to make these three things match before launch:

  • the server-rendered path
  • the client router path
  • the canonical URL in the HTML

If one of those says /guide and another says /guide/, you already have a split. A browser can recover from that; a crawler may treat it as two documents, so review the setup with a technical SEO specialist if the site has many route combinations.

This is also where URL state needs discipline. A search filter that belongs in a query string should not be inserted into every internal link if the page body does not change. A tab panel that only switches visible content should often stay out of the address bar entirely unless it is meant to be shared and indexed.

Hydration fixes can be small or large. A small fix is changing one router setting. A larger fix is rewriting how the app stores UI state so that only true document changes alter the URL. The larger fix is worth it when the site has many routes, because patching one duplicate after another usually just creates the next variant.

Which fixes should come first?

The first fixes should be redirects, internal links, and canonical tags, in that order, because they remove duplicate URLs without making the app more complex. This order matters on headless and JavaScript sites where one bad template can spread the same mistake across hundreds of pages.

A practical priority list looks like this:

  1. Redirect duplicate path variants.
    Fix slash twins, legacy aliases, and renamed routes first. This removes extra URLs from the path layer quickly.

  2. Clean internal links.
    Update menus, feeds, cards, and router links so they only point to the preferred URL. If the site keeps linking to the wrong form, the duplicate will return.

  3. Set the canonical in server-rendered HTML.
    This helps the preferred URL win when the same content still exists in more than one place.

  4. Tighten URL state rules.
    Stop filters, tabs, and sort values from creating crawlable URLs unless they deserve their own indexable page.

  5. Fix the route model in the app or headless CMS.
    This is the bigger step when the CMS produces several slug forms, or the router creates a path that does not match the content model.

That order is not for every site. If the root problem is a bad headless CMS rule that keeps generating duplicate slugs, fix the CMS field behavior before the front end. If the problem is only one component leaking query parameters into links, do not rebuild the whole routing layer.

When should this stop being a front-end fix?

This should stop being a front-end fix when the duplicate URLs are coming from the content model, not from the app shell. If the headless CMS publishes several records that point to one article, or the routing rules create conflicts at publish time, the problem belongs in the data layer.

That is the point where more client-side patches stop helping. A JavaScript app can hide bad structure for a while, but it cannot make two CMS records into one URL without a clear rule. If the same rendered HTML is reachable through different paths because of the way content is stored, the fix belongs upstream.

A good test is simple: ask whether the duplicate still exists if you strip away the UI state. If the answer is yes, the issue is in the slug, route, or publish pipeline. If the answer is no, the issue is probably in query handling, hydration, or internal links.

This is also where a broader Bing duplicate URL remediation workflow matters. The page here is for fixing duplicate URLs caused by rendering and routing systems, not for source-HTML comparison or Bing rendering diagnostics. If the duplicate is tied to indexing behavior rather than URL creation, that is a different job.

A site that uses a headless CMS and a JavaScript app needs one owner for URL rules. Without that, each layer invents its own version, and the result is index bloat, split signals, and a cleanup job that keeps coming back.

Can javascript sites create duplicate urls?

Yes. A JavaScript site can create duplicate URLs when the router, links, or URL state produce several address forms for the same rendered page. Common examples are slash differences, query strings for view state, and route aliases that all show the same content.

The fix is to pick one preferred path and make the app stop publishing the others. If the same content is still reachable at several addresses after that, the server layer also needs a redirect rule. For implementation details, compare the routing behavior with MDN’s History API guide and the Google Search Central duplicate URL guidance.

How do headless sites create url variants?

Headless sites create URL variants when the CMS, slug rules, and front-end router do not share one path model. A content item may be published with one slug in the CMS, another in the app, and a third through filter or preview parameters.

The fix is to make the CMS the source of the preferred path and make the front end follow that path exactly. If the site must support drafts or previews, those URLs should stay out of crawlable links. For canonicalization decisions, see Google Search Central and the WHATWG URL Standard.

What should be fixed before rendering causes duplicates?

The preferred URL rule should be fixed before rendering causes duplicates, because rendering only exposes the problem faster. If the router, links, and CMS already disagree, rendered HTML will spread that disagreement to more URLs.

Start with internal links, route aliases, and canonical tags. Then fix hydration and URL state so the page does not create new forms after load. See also related guidance on canonical tags, JavaScript SEO, and technical SEO.

Drafted with AI; not yet reviewed by a person.

Leave a Reply

Your email address will not be published. Required fields are marked *