Canonical URLs

Canonical URLs are something you don’t normally need to worry about; except in exceptional circumstances. However, they are worth knowing about all the same.

What is a ‘Canonical URL’?

It is the ‘definitive source’ of the information the page is presenting.

For instance, I previously recently wrote an article explaining the differences between domain names, website hosting, email hosting, DNS etc.

The website address for that article is:

The Canonical URL for that article:

But they are the same?!

Yes – and for the vast majority of web pages, they will be the same. Remember I said it was for exceptional circumstances?

So when could they be different?

One example is Google’s AMP system. AMP stands for Accelerated Mobile Pages and is a drive by Google to help speed up pages for people on smartphones by automatically offering a very stripped down version of a web page (so that it loads faster).

We have AMP working on the Glass Mountains website and the AMP version of the above URL is this:

If you notice, there is an additionally /amp/ on the end of the URL.

Which now means we have two distinct URLs showing pretty much exactly the same content.

And if that sets alarm bells off in your head regarding ‘duplicate content’ then it should – because Google generally does not like duplicate content as this can be very bad for SEO.

Looking under the surface….

However, if we view this /AMP/ web page’s source (below using the Google Chrome ‘inspect’ tool), we’ll see the following:

Fig 1- viewing the Canonical URL on a AMP page
Fig 1- viewing the Canonical URL on a AMP page

The line we are interested in is this one:

<link rel="canonical" href="">

This is a hidden instruction to Google (and other search engines) that the definitive source for the information is on the indicated URL (note the lack of /amp/ from the end).

This meta information help tells Google that this is not duplicate content.

WordPress and Canonical

If you ever need to set the Canonical URL for a page, you can do that via the Yoast SEO plugin via the ‘advanced’ panel:

Fig 2 - Yoast's 'Canonical URL' field under 'Advanced'
Fig 2 – Yoast’s ‘Canonical URL’ field under ‘Advanced’

However, in the vast majority of cases you should never need to alter this setting (which is why Yoast squirrel it away under ‘Advanced’).

If you have any comments or questions about this, why not hop over to #theWPshow – our free Facebook Group for businesses who use WordPress.

For further reading on this, you can look at Google’s guide to canonical URLs.

1 Comment »

One Response

  1. Simon Cox says:

    Google sees canonicals more of a hint than an instruction and will use a different URL if it thinks it is more definitive. As you said Joel – should not be a problem on a WordPress site but its always worth a check in case a theme has mucked something up. Also worth checking is if there any capital letters in the url as they might be automatically converted for the canonical. Google will see:

    as a different url to your example but will resolve to the same page.

    Hope that helps and a great article!

Leave a Reply