rel-canonical
This article is a stub. You can help the IndieWeb wiki by expanding it with relevant information.
rel=canonical is a way to indicate that a hyperlink links to the original and canonical version of the current page.
Compare rel=canonical with rel=alternate.
Why
You should use rel=canonical to reduce, minimize, and ideally eliminate any duplicate search results for your pages, i.e. you should canonicalize the following variants of your homepage and permalinks:
This can also be important for link previews in other Google products, as described in an example below.
How to
Put a link rel=canonical in the head of your homepage and permalinks pages, e.g.:
<link rel=canonical href="https://you.example.com/permalink" />
IndieWeb Examples
Tantek
Tantek Γelik has had rel=canonical support for a while from his homepage and permalinks to their plain versions without any "?" query, and for the permalinks with the explicit URL slug. On 2019-272 he added support for http: pages to link rel-canonical explicitly to the https version of the URL so that Google Search and other search engines would prefer the https versions and avoid duplicate indexing of permalinks.
gRegor Morrill
gRegor Morrill has had rel-canonical on gregorlove.com since approximately 2016. Using ProcessWire I found it easy to add the canonical URL for every page. It links to the https version of the URL.
I also found rel-canonical can be important for link previews in other Google products like Docs:
- 2026-10-02 : Canonical Links in Google Products (archived)
add yourself!
See Also
- http://microformats.org/wiki/rel-canonical
- https://en.wikipedia.org/wiki/Canonical_link_element
- Duplicate Content and SEO | Medium
- https://gist.github.com/aaronpk/786c84682056bcbb5ebdd3d4932d9199
- https://support.google.com/webmasters/answer/139066?hl=en