When implemented in HTML, the canonical tag needs to appear in the <head> of your page’s HTML.
Once you understand which URL is the canonical version, the duplicate versions of that URL would have the canonical tag applied pointing to the canonical version.
For example, if httpould need to see in the <head> the following canonical tag:
<link rel=“canonical” href=“h
How to implement canonical tags on PDFs
On non-HTML documents such as PDFs, there’s of course no way to add the canonical tag to the <head>. There may be occasions when you’d want to implement a canonical though. For example, if you have PDF versions of content which is a duplicate of an HTML page.
In these cases, it’s possible to add the canonical tag via the HTTP header.
For example :
HTTP/1.1 200 OK
Content-Type: application/pdf
Link: <h
Common canonical tag mistakes
Non-200 status URLs in canonical tags
URLs referenced in your canonical tags should only point to indexable, 200 status URLs, so make sure there’s no 301 redirects or 404 URLs within your canonical tags. This sends conflicting signals to Google, as we’re saying that the preferred version of the page which we want indexed, actually redirects somewhere else or is broken!
Non-200 URLs could manifest themselves list to data in several ways, like the http and trailing slash examples below.
Canonical tag pointing to http
Occasionally you might see canonical tags on https sites that are correctly self-referencing, but pointing to the http version of the URL.
This is a mistake, as that will likely result in 301 redirect to the https URL. URLs within canonical tags should always deliver a 200 status.
Canonical tag pointing to incorrect trailing slash version
As outlined above, canonical tags can be used to resolve duplication caused by the same URL being accessible with and without a trailing slash.
But even if both versions aren’t accessible, make sure to check that canonical tags are pointing to your preferred trailing slash URL, otherwise it’ll lead to a non-200 status.
Relative canonical tags
Absolute URLs containing the entire address should be used in the canonical tag rather than relative URLs. For example,
<link rel=“canonical” hre
rather than
<link rel=“canonical” href=“/mens-shirts/” />
Non-canonical URLs in sitemaps
The only URLs in your xml sitemaps should be your canonical URLs, and these should be indexable, 200 status URLs.
The canonical tag indicates the preferred section 2: the key audience or persona version of a page, and if non-canonical URLs are in your sitemap, it introduces some confusion over what the preferred version of the page actually is.
Keep things consistent everywhere you can: xml sitemaps, internal linking structure, canonical tags and any other links to URLs such as hreflang tags should all reference the same, canonical version of a URL. This keeps things as clear as possible for Google regarding crawling and indexing.
Canonical tags and pagination
Pagination needs to be properly handled to minimise SEO issues. In a numbered sequence of pages, each page in the sequence should have a self-referencing canonical tag.
A common mistake in paginated sequences is adding a canonical tag to each numbered page in the sequence pointing to the first page in phone number iran the sequence. For example
Google will be less likely to crawl URLs that canonicalise to a different URL. If those paginated URLs contain any valuable content (i.e older blog articles), we want to ensure