Friday, March 4, 2016

How to Remove Joomla's Canonical Tag


This is to clear any misconception about having a self-referenced Canonical Link Element, as using one is not an issue, and how could it be - to say that the page you are viewing at this url is actually the one you mean to display (??)

Google is perfectly fine with this. As far as I know, it only Bing that has a recommendation to avoid using self-referencing canonical urls, but even if it exists it won't make the page not indexable.

Canonical URLs is not the reason that some of your pages have not been indexed by Google. If that was true, then none of your pages should have been indexed.

Google will not guarantee that will index all the pages of a website in a given time period.

$doc = JFactory::getDocument();
 foreach ( $doc->_links as $k => $array ) {
 if ( $array['relation'] == 'canonical' ) {
 unset($doc->_links[$k]);
 }
 }