How to use Canonical URLs in Joomla 3

This article describes how you can use canonical URLs in Joomla 3 to improve link and ranking for site

21 Nov 2014 Tips & Tutorials

How to use Canonical URLs in Joomla 3

What is a Canonical Url

Canonical links are tags that helps webmasters avoid duplicate content issues by telling Google indexes the correct page or specifying the "canonical", or "preferred" version of a web page for a part of SEO. Many sites are encountering duplicate problems in the Google index. Duplicate entries happen when the same content is accessible from multiple URLs. For instance, http://example.com/page.html would be indexed by search engines differently from page http://example.com/page.html?parameter=1, even though both URLs return the same content. It is one of the methods advised by Google for handling with your URL's.

How to use Canonical URLs

I'm assuming that we have 2 duplicate Urls like above: http://example.com/page.html?parameter=1 and http://example.com/page.html

When this page is requested, you can tell the search engines that the preferred and correct URL is http://example.com/page.html by specifying the preferred URL with this HTML tag in head area of your source code:

<link href="http://example.com/page.html" rel="canonical" />

Solutions for canonical URL in Joomla 3

Joomla 3 sometimes has issues with canonical URL's, so if you are serious about Joomla SEO, it is a problem that needs to be addressed. There are some solutions to sort them out:

  • Create an override for the file /plugins/system/sef/sef.php on line 51.
  • If it just concerns one or two pages on the whole site, you could consider using ReReplacer plugin to set the correct tag.
  • Use a plugin or extension. The major SEF extensions all set a canonical URL such as sh404SEF. When you have this in place, you need to install the Canonical Links plugin from Gnome on the Run. This creates the canonical link tag for your SEF URLs automatically. You can view more how to add Canonical URL in SH404SEF