SEO basics

How to fix: Canonical tag

A canonical tag tells search engines which URL is the preferred version of a page when the same content is reachable at several addresses.

Not sure whether your site has this problem? Check it in seconds.

Why it matters

The same page often exists at example.com/page, www.example.com/page, with a trailing slash, or with tracking parameters. Without a canonical hint, search engines have to guess which one to show, which can split signals between versions.

How to check

Look for <link rel="canonical" href="..."> in <head>. The URL should be absolute and normally point to the page itself.

How to fix it

HTML

<link rel="canonical" href="https://www.example.com/page">

Next.js

export const metadata = {
  alternates: { canonical: '/page' },
};

Common mistakes

Frequently asked questions

Is canonical a command?

It's a strong hint, not a guarantee; search engines can choose a different URL.

Related guides

Guidance is general. Test header and DNS changes on a staging copy first, and check your hosting provider's documentation for platform-specific steps.