What Are Canonical Tags?
A canonical tag (also known as rel="canonical") is an HTML element that tells search engines which version of a URL is the "master" copy. It helps prevent duplicate content issues by consolidating ranking signals to a single preferred URL.
The canonical tag lives in the <head> section of a page and looks like this:
<link rel="canonical" href="https://example.com/preferred-page" />
Self-Referencing vs. Cross-Domain Canonicals
Self-referencing canonical: The canonical URL matches the page's own URL. This is the most common and recommended setup. It confirms to search engines that the current page is the preferred version.
Cross-domain canonical: The canonical URL points to a different page or domain. This is used when content is intentionally duplicated across domains or when you want to consolidate similar pages into one. For example, if you syndicate an article on Medium, the Medium version should have a canonical tag pointing back to your original article.
Common Canonical Tag Mistakes
- Missing canonical tag: Without a canonical tag, search engines must guess which version of a page to index. Always include a self-referencing canonical at minimum.
- Canonical pointing to a 404 page: If the canonical URL returns a 404 error, search engines may ignore it entirely, leading to indexing confusion.
- Multiple canonical tags: Having more than one canonical tag on a page sends conflicting signals. Search engines may ignore both.
- Canonical URL with different protocol: Pointing an HTTPS page's canonical to an HTTP version (or vice versa) creates a mismatch that can confuse crawlers.
- Relative URLs in canonical tags: While browsers can resolve relative URLs, it is best practice to use absolute URLs in canonical tags to avoid ambiguity.
- Canonical on paginated pages: Each page in a paginated series should have a self-referencing canonical, not all pointing to page 1.
How to Implement Canonical Tags
Add the canonical tag inside the <head> section of your HTML. Most CMS platforms (WordPress, Shopify, Squarespace) include canonical tags automatically, but you should verify they are set correctly.
- WordPress: Plugins like Yoast SEO and Rank Math automatically add canonical tags. You can override them per page in the post editor.
- Shopify: Canonical tags are added automatically to all pages by the theme.
- Custom HTML: Add
<link rel="canonical" href="https://yoursite.com/page" />in your<head>tag. - HTTP Header: For non-HTML resources (PDFs, etc.), you can set a canonical via the
LinkHTTP header:Link: <https://example.com/page>; rel="canonical"
All Free SEO Tools
More free tools to help with your SEO workflow.