← Docs
SEO

Recipe: rel-canonical strategy + duplicate-content guard

Prevent search engines from splitting ranking signals across duplicate or parameterized URLs.

Problem

E-commerce filters, UTM parameters, session IDs, and trailing slashes create multiple URLs serving identical content. Without canonical signals, Google treats each variant as a separate page, diluting your ranking and wasting crawl budget.

Solution

Emit a <link rel="canonical"> tag in every page head pointing to the single authoritative URL. Combine with self-referencing canonicals on the canonical page itself so the signal is unambiguous.

Implementation

// app/products/[slug]/page.tsx
export default function ProductPage({ params }) {
  const canonical = `https://getnimbus.net/products/${params.slug}`;

  return (
    <>
      <Head>
        <link rel="canonical" href={canonical} />
      </Head>
      {/* page content */}
    </>
  );
}

Duplicate-content guard

  • 301 redirect trailing slashes to non-trailing (or vice versa — pick one).
  • noindex paginated pages beyond page 1; canonical page 1 to the base collection URL.
  • robots.txt disallow for filter query parameters that generate infinite combinations.
  • Sitemap lists only canonical URLs — never parameterized variants.

Verification

Run npx meridian seo-audit --check-canonicals to scan every route. The audit flags missing canonicals, mismatched self-referencing tags, and pages where the canonical target returns a different status code.