Canonical URLs in Joomla 3.x

Did you know that in Joomla 3, the SEF system plugin automatically sets the Canonical URL for any page you create? Did you know that the SEF system plugin has a bug in it that displays incorrect information for the Canonical URL that will prevent any sub-pages to a "blog roll" display from having the correct Canonical URL? 

This problem affects not only the major search engines, but also Social Media sites such as Facebook. That was how I found out about it. We were busily posting our blogs out to Facebook when the first issue we noticed was that the associated blog image was not displaying correctly. We utilized the Facebook Lintr to see what Facebook was seeing, and it certainly was not seeing the associated image. I missed it the first time, but right there at the top, it reports the URL submitted and the Canonical URL!

I checked in many different areas to see if there was a Canonical URL setting:

  • Global Configuration
  • Menu Settings
  • Content Settings
  • SEF Plugin Settings
  • Template Settings

There wasn't. I did some searching, and finally found what I was looking for!  Read more about the bug in the Joomla Bug Tracking system.  It appears that the bug has been fixed, but the patch has not been rolled in to the latest updates. So, in order to correct this issue in the interim and still provide Canonical URLs for the website, I had to dive in to the code. Following instructions that I found in the Joomla forum, I commented out the line that generates the Canonical URL information.

I opened the editor I use for coding and navigated to the SEF Joomla plugin. Sure enough, it was right there on line 51. The plugin is located at site-root -> plugins -> system -> sef.php 

Canonical URLs do help with preventing duplicate content flags when there are other issues with your site, or when there are multiple ways to access a page of your site, such as with Joomla. If you make this change, I encourage you to install an SEO component such as the BOSS SEO component, or RS SEO by the folks over at RS Joomla. Both of these components offer the capability to set the Canonical URL for each page of your site. The downside? Both components require manual intervention to update the Canonical URL. But, both components also allow you to set your title, meta keywords and description.  

After taking the time to do this, my canonical conundrum is corrected and we are again humming along! 

How are your canonical URLs? This is one item that can completely undermine your SEO initiatives. Take some time to make sure that you are giving the right information to the search engines and to social media!