How to fix seo facet url not canonicalized on Next.js

Add a canonical tag to every filtered, sorted, and paginated collection/category URL pointing back to the clean (unfiltered) category URL, so Google consolidates duplicate pages and focuses crawl budget on your real content.

Steps for Next.js

  1. In the App Router (Next.js 13+): export a generateMetadata function from your category page (e.g. app/collections/[slug]/page.tsx). Inside, construct the canonical URL from params only (no searchParams) and return it as: return { alternates: { canonical: `https://www.example.com/collections/${params.slug}` } };
  2. In the Pages Router: use next/head inside your category page component. Compute the canonical URL by using router.pathname (not router.asPath, which includes query strings): <Head><link rel='canonical' href={`https://www.example.com${router.pathname.replace('[slug]', router.query.slug)}`} /></Head>.
  3. Verify by running next build && next start, then viewing source on a filtered URL to confirm the canonical is the clean path.
Official Next.js documentation ↗

What is seo facet url not canonicalized?

When shoppers filter your product listings by size, colour, price, or sort order — or browse to page 2, 3, etc. — your store generates a new URL for each combination (e.g. `/collections/hoops?color=red&sort=price` or `/collections/hoops?page=5`). These "facet URLs" display largely the same products as the base category page, making them near-duplicate pages. A canonical tag is a small piece of HTML that tells Google: "Treat THIS page as the authoritative, indexable version — not the one you just crawled." Pointing every facet URL's canonical back to the clean category URL (e.g. `/collections/hoops`) is the standard, Google-recommended way to handle this.

Without canonical tags, Google may index hundreds or thousands of near-identical filter and pagination URLs instead of your core category pages — diluting the ranking signals (links, authority, clicks) that should be concentrated on those pages. Crawl budget is wasted on low-value filter combinations, meaning new or updated products get discovered more slowly. Duplicate content confusion can push the wrong URL into search results, giving shoppers a paginated or pre-filtered page that looks broken. Fixing canonicals consolidates ranking signals onto your clean category pages, improves crawl efficiency, and protects your organic traffic from unnecessary duplication penalties.

See the complete Seo facet url not canonicalized guide for every platform and the full background.

Not sure if your Next.js store has this?

Run a free SEOLZ scan — we’ll find seo facet url not canonicalized and every other issue across your whole site.

Scan my site free

Fix seo facet url not canonicalized on another platform