How to fix missing canonical on Headless / Custom (I build in code)
Add a self-referencing canonical tag to every page so Google knows which URL is the definitive version of that content.
Steps for Headless / Custom (I build in code)
- In a Next.js project, use the `<Head>` component from `next/head` in each page component or use the `metadata` export (App Router) to add `alternates: { canonical: 'https://www.yourstore.com/your-page' }`.
- In a Nuxt.js project, use `useHead()` composable or the `head` property in your page component to add `{ link: [{ rel: 'canonical', href: 'https://www.yourstore.com/your-page' }] }`.
- For any other framework, ensure the canonical tag is rendered server-side (not only client-side via JavaScript) so crawlers see it in the initial HTML response.
- Build the canonical URL dynamically from the current route/path — never hardcode it — and always use the absolute URL (including https:// and domain).
- Verify by fetching the raw HTML of a page with `curl -s https://www.yourstore.com/your-page | grep canonical` and confirming the tag is present.
What is missing canonical?
A canonical tag is a small snippet of HTML code placed in the `<head>` of a web page that tells search engines "this is the official, preferred URL for this content." It looks like `<link rel="canonical" href="https://www.yourstore.com/your-page/" />`. When the same (or very similar) content is accessible at multiple URLs — for example, with and without "www", with tracking parameters like `?utm_source=email`, or through category filter combinations — the canonical tag acts as a signpost that points all the credit back to one master URL. Without it, search engines must guess, and they often guess wrong.
Without a canonical tag, Google may discover multiple URLs showing identical or near-identical content and split the ranking signals (links, authority) across all of them instead of concentrating them on the one URL you actually want to rank. This directly dilutes your organic search rankings and can cause the wrong URL to appear in search results — hurting click-through rates and conversions. For ecommerce stores, product pages are especially vulnerable because filtered URLs (`/shoes?color=red&size=10`), session IDs, and affiliate parameters create dozens of duplicate variants every day. Consistently missing canonical tags is one of the most common technical SEO issues that silently erodes organic traffic over time.
See the complete Missing canonical guide for every platform and the full background.
Not sure if your Headless / Custom (I build in code) store has this?
Run a free SEOLZ scan — we’ll find missing canonical and every other issue across your whole site.
Scan my site free