This page short URL: qx4

Preamble

Just like redirects, being able to insert canonical links into pages is a major tool when optimizing your web site. sh404SEF makes it easy to add a canonical tag to any page on your site, without having to write custom PHP code for instance.

There are two most common use of the canonical tag:

  • when the same content is displayed on different page. For instance, a product can be part of 2 different categories on an e-commerce site; or an upcoming event is displayed under different users calendar. In both case, we should select one URL and tell search engines to concentrate all ranking and trust on that URL, instead of splitting it between different pages.
  • when a unique page may be accessed through different variations of its URL. For instance, tracking codes are sometimes added to links in ads (/joomla/using-joomla?clid=4566sdf6879sdfsd6f45sd), so as to be able to track clicks. Or a category page could be displayed either in ascending or descending order (/catalog/books?sort=asc). In such cases, we want to tel search engines to only index and rank one URL: /joomla/using-joomla or /catalog/books.

With a canonical link inside a page, you are telling search engines that the current page URL is perfectly valid and will keep existing but that it's not what they should register ranking signals for. Instead, they should use the preferred URL specified in the canonical link. A visitor coming to that page won't notice, and will stay on the same page.
That's a major difference from setting up a redirect, where you're saying to both visitors and search engines they should forget about the current URL and next time go directly to the new one. A visitor coming to the page will be taken to the new page, and won't even see the old one.

A canonical link is only meant to be used by search engines. It's actually not visible to visitors, and you can verify its presence only by displaying the source code of a page (Ctrl-U/⌘-Option-U in most browsers). For instance:

Canonical link inside a Joomla page

How to setup a canonical tag?

This page describes how to setup a single canonical: you have one URL on your site, and want search engines to use another one instead. sh404SEF also lets you set up aliases rules, when you want to canonicalize many URLs with just one instruction. Please see this page for more details.
Let's use an example from Joomla! default sample data:

Some com_contact URLs with Joomla! sample data

We have outlined 2 URLs related to com_contact:

  • the first page is a Featured view, where important contacts are shown
  • the second page is a full list of our sample contacts

This is a situation where we could want search engines to concentrate ranking and trust on the permanent listing of contacts, instead of the "featured" ones, which may come and go and actually partially duplicate some content from each individual contact page. To achieve this, we're going to add to the /featured-contacts/ page a canonical link pointing to: /sample-data-contact/all/

This is done by opening the /featured-contacts/ record, and typing in the /sample-data-contact/all/ URL in the Canonical URL field:

Adding a canonical URL using sh404SEF


You can also enter a canonical URL located on another web site. Simply enter a full URL, starting with http://example.org/... or https://example.org/...


After adding this canonical, we can check the source page of /featured-contacts/ :

View source of page after adding a canonical link

Be aware that a canonical link is a hint for search engines, they won't always comply with it. If you don't want or cannot perform a 301 redirect to a new location, canonical is however the best and standard way to handle content that can be reached through multiple URLs.