Canonical tags are easy, right? What’s the worst that could happen?
Columnist Patrick Stox outlines when to use the canonical tag, as well as some common problems that occur during implementation.
In an ideal world, there would only be one version of each page. Too bad the world is messy and the same content can exist at multiple locations on the same website and other websites. Years ago, a solution was adopted to help with these duplicate content issues: the “canonical link element,” better known as a “rel=canonical” or “canonical tag.”
How does a canonical tag help with SEO?
The canonical tag helps solve duplicate content issues by setting the preferred version of a page and passing signals such as links to the preferred version. The tag helps consolidate duplicate content caused by issues such as:
- HTTP and HTTPS
- www and non-www
- parameters and faceted navigation
- session IDs
- trailing slashes
- index/default pages
- alternate page versions such as m. or AMP pages or print versions
Where to add a canonical
Most SEOs are aware that you can use a canonical tag in the head section, such as:
<link rel="canonical" href="https://example.com/" />
What you may not realize is that a canonical tag can be set in the HTTP header as well, such as:
HTTP/1.1 200 OK
Link: <https://example.com/>; rel="canonical"
The canonical in the header can be used for any page, but the most common use case is for setting a preferred version for PDFs, as Google did when Dan Sharp hijacked Google’s SEO Starter Guide.