How should you implement canonical URLs, and when should you use other methods?

ProcrustesPR

When you need to keep multiple URLs with identical or highly similar content, add a rel=”canonical” tag to the HTML head section to point to the preferred canonical URL. If an old URL is being retired, use a redirect instead. For non-HTML documents such as PDFs, you can specify the canonical URL through an HTTP header. A sitemap can also help communicate your preference. Choose a method based on whether the alternative versions need to remain available, rather than relying on canonical tags for every situation. Canonical tags express a preference but do not guarantee that Google will follow it.

ProcrustesPRProcrustesPRHow can I tell whether an SEO tactic breaks spam rules?

Keeping duplicate pages: specify the same primary URL in the head

First, identify which URLs actually serve duplicate content, then choose the primary version. Do not designate one page as the canonical version of another simply because they cover the same topic.

For example, if a product URL with parameters and a clean URL display the same content, you can place the following tag in the duplicate page’s head. The primary page can also use the same tag to point to itself:

<link rel=”canonical” href=”https://example.com/products/blue”>

This tag signals the preferred version; it does not take visitors to another URL as a redirect does. Welly’s 2022 article also notes that canonical tags are not guaranteed to take effect—the final choice of canonical URL remains Google’s.

Keep internal links and sitemaps consistent

Google’s documentation recommends pointing internal links directly to canonical URLs rather than continuing to link to duplicate versions. Consistent links help Google understand which version the site prefers.

  • When you can specify the canonical URL in the HTML source, provide it there and avoid changing it with JavaScript.
  • If you can only specify it through JavaScript, avoid supplying conflicting canonical URLs in the source and the script.
  • List the selected canonical URLs in the sitemap to supplement other signals of your canonical URL preference.

Sitemaps are easier to maintain for large sites, but Google still has to determine which pages are duplicates of the listed URLs. A sitemap also provides a weaker signal than rel=”canonical”, which directly identifies the corresponding canonical URL.

Use an appropriate alternative when retiring old URLs or handling documents

  • When an old page no longer needs to remain available: use a permanent redirect to send traffic from the old URL to the preferred version. Google’s documentation recommends HTTP server-side redirects for Google to recognize the redirect as quickly as possible.
  • For non-HTML documents: documents such as PDFs cannot use a tag in an HTML head section, so you can provide a rel=”canonical” header in the HTTP response.

Using an HTTP header requires the ability to modify server responses. Whether you use tags or headers, you need to keep the mappings between duplicate and canonical versions up to date when a site is large or its URLs change frequently.

When redirects are not possible, a link is only a fallback

Google’s documentation recommends using JavaScript redirects only when server-side or meta refresh redirects are not possible, because rendering failures may prevent Google from detecting them.

If none of these methods can be implemented, at least add a link to the new page and a notice explaining the move to help visitors find the content. However, not all search engines treat this approach as a redirect. Known as a crypto redirect, it should not be relied on when other options are available.

ProcrustesPRProcrustesPRShould I rewrite or update an old article that does not rank?

Canonical URLs: perspectives from across the web

After setting a canonical URL, how can you check whether Google has adopted it?

You can use the URL Inspection tool in Google Search Console to check a specific URL's indexing status and canonical selection, then compare it with the version you specified. “Alternate page with proper canonical tag” usually requires no action, but you should still confirm that it points to the correct URL. A canonical tag is a preference signal, not a guarantee that Google will follow it. Someone who implemented canonical tags on a large site reported that many non-canonical URLs remained indexed afterward.

Should all paginated pages point to the first page?

If the paginated pages display different content, Semrush's 2024 article recommends giving each page a self-referencing canonical and connecting the pages with clear navigation links, rather than treating them all as duplicates of the first page. The article also recommends avoiding blanket use of noindex on paginated pages, arguing that this could hinder search engines from discovering content through pagination. This is the article's recommendation, not an official rule that applies in every situation.

Can a page have multiple canonical tags?

Each page should specify only one canonical URL. Avoid adding multiple canonical tags or specifying conflicting URLs in HTML and HTTP headers. Semrush suggests using self-referencing tags on primary pages to make the preferred URL clear, even when there are no obvious duplicate versions. This is practical advice; a canonical tag is not a requirement for every page to be indexed.

Do you have to edit code manually when using WordPress?

Not necessarily. A 2022 article recommends using a plugin to set canonical URLs. Another article describes the settings fields in Yoast SEO and Rank Math and notes that they can generate self-referencing tags by default. During implementation, check that the URLs actually output by the plugin meet the page's needs, and avoid adding conflicting tags. Interfaces and default behavior may change between versions.

ProcrustesPRWill Reposting Social Content on My Website Cause a Duplicate-Content Penalty?

References

  1. 重新導向與 Google 搜尋 | Google 搜尋中心  |  Documentation  |  Google for Developersdevelopers.google.com — Source used in the article above.
  2. 如何使用 rel="canonical" 和其他方法指定標準網址 | Google 搜尋中心  |  Documentation  |  Google for Developersdevelopers.google.com — Source used in the article above.
  3. Canonical Tag Not Being Recognizedwebmasters.stackexchange.com — Discusses: After setting a canonical URL, how can you check whether Google has adopted it?
  4. Canonical URLs: SEO Best Practices, Common Issues, and How to Fix Themwww.semrush.com · 2020-05-15T17:19:00Z — Discusses: Can a page have multiple canonical tags?; Do you have to edit code manually when using WordPress?
  5. What Are Canonical Tags?neilpatel.com · 2022-09-10T07:00:00+00:00 — Discusses: Do you have to edit code manually when using WordPress?
  6. Canonical URL是什麼?Canonical SEO的重要性報你知!welly.tw · 2022-03-01T02:30:34.608Z — Discusses: After setting a canonical URL, how can you check whether Google has adopted it?
  7. Pagination and SEO: A Complete Guide to Best Practiceswww.semrush.com · 2024-01-26T14:45:00Z — Discusses: Should all paginated pages point to the first page?
  8. How to Perform a Complete SEO Audit in 20 Stepswww.semrush.com · 2020-06-01T11:00:00Z — Discusses: After setting a canonical URL, how can you check whether Google has adopted it?

Related articles

How can I tell whether an SEO tactic breaks spam rules?Should I rewrite or update an old article that does not rank?Will Reposting Social Content on My Website Cause a Duplicate-Content Penalty?What types of URLs are there, and what are they used for?What are the common mistakes, limitations, and costs of using subdomains?Can two URLs point to the same website?How to improve on-site content and structure: audit pages first, then address content gaps and internal linksHow can you use multiple domains to build content and traffic while assessing the risks?
ProcrustesPR
ProcrustesPR