What are canonical tags and how do they prevent duplicate content?

Home / Everything About / Everything About SEO / What are canonical tags and how do they prevent duplicate content?

Do you know that duplicate pages on your website are ranking killers? When the same content lives at multiple URLs, search engines split ranking power across all of them instead of concentrating it on one strong page. Your homepage might be accessible at example.com, www.example.com, and example.com/index.html. Same page, three URLs, one third the ranking power each. Canonical tags solve this with a single HTML line. It tells search engines which URL wins. The rest stay live but give all their authority to the chosen one.

A canonical tag is an HTML tag that tells search engines which URL is the preferred version of a page. It looks like this:

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

You place this tag in the head of your HTML. When search engines crawl the page, they see the tag and understand: "This page is a duplicate. The real version is at https://www.example.com/article. Give all the ranking power to that URL."

Canonical tags are not directives. They are suggestions. Search engines usually follow them, but they are not guaranteed. They are hints that tell search engines your preference.

Why duplicate content is a problem

Duplicate content confuses search engines. If you have five versions of the same page, search engines must decide which one to index and rank. They might index all five and split ranking power among them. Or they might index only one and ignore the others.

Either way, you lose. If ranking power is split five ways, each URL ranks lower. If only one URL is indexed, the others waste crawl budget. Canonical tags fix both problems by consolidating ranking power to one preferred URL.

Duplicate content also creates indexing issues. Search engines have limited resources. If half your crawl budget goes to duplicate pages, the other half goes to unique content. Your important pages crawl less frequently.

Common sources of duplicate content

Session IDs create duplicates. Parameters like ?sessionid=abc or ?utm_source=facebook create new URLs even though the content is identical. Canonical tags tell search engines these are duplicates.

HTTP and HTTPS versions of the same page create duplicates. Www and non-www versions create duplicates. Print versions and mobile versions might create duplicates. Trailing slashes create duplicates (example.com/page vs example.com/page/).

Pagination creates a special type of duplicate. Page 1 of a paginated series might have similar content to pages 2 and 3. Products appear on category pages, search results pages, and other listing pages. All these create duplicates that benefit from canonical tags.

How to use canonical tags properly

Place the canonical tag in the head section of your HTML. Include the full URL of the preferred version. Point to yourself (self-canonical) if this is the primary version. Point to the original if this is a duplicate.

Here is a correct example. Your article lives at www.example.com/article. It is also accessible at example.com/article. Both pages should have this canonical tag:

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

This tells search engines: "Both URLs are the same. The real version is www.example.com/article. Consolidate ranking power there."

Always use absolute URLs in canonical tags (the full URL including https://). Never use relative URLs (just /article). Always use the exact URL you want to rank, including protocol, www or non-www, and trailing slashes.

Self-canonical tags and best practices

Many sites add a self-canonical tag to every page. This means each page points to itself as canonical. This is not necessary but is increasingly common as a best practice. It reinforces that this is the preferred version and prevents accidental duplicate issues.

Only one canonical tag per page. Do not add multiple canonical tags pointing to different URLs. Search engines will ignore the tag or pick randomly.

Do not create canonical chains. Page A should not point to Page B which points to Page C. Always point directly to the final canonical URL.

Use canonical tags across subdomains only if you truly want to consolidate. Canonical tags across domains (example.com pointing to example.net) work but are unusual. Typically you use them within the same domain.

Canonical tags vs redirects

Redirects and canonical tags serve different purposes. A 301 redirect permanently moves a page. Visitors and search engines are sent to the new URL. The old URL disappears from search results.

A canonical tag does not redirect visitors. The page displays normally. But search engines understand it is a duplicate and give ranking power to the canonical version. Use redirects when you want to permanently move a page. Use canonical tags when you want to keep multiple URLs but tell search engines which one to rank.

If you are consolidating two pages into one and the old page is no longer needed, use a 301 redirect. If you want to keep multiple versions of a page (for different audiences or purposes) but have only one rank, use a canonical tag.

Testing your canonical tags

Check if your canonical tags work. Go to your page in a browser. Right-click and select "View Page Source". Search for "rel=canonical" or "canonical". The tag should appear in the head section.

Verify the URL is correct. Make sure it points to the version you want to rank. Make sure it uses the exact protocol (https not http), the exact domain (www or non-www), and the exact path.

Check in Google Search Console. Go to the URL Inspection tool, enter a URL with a canonical tag, and Google will show you the canonical it found. This confirms Google sees your canonical tag correctly.

Frequently asked questions

Do canonical tags affect rankings?

Can I use canonical tags across different domains?

What happens if I use the wrong canonical tag?

Should every page have a canonical tag?

Can I use both redirects and canonical tags?

Do hyphens vs underscores in URLs matter for canonicals?