Keyword

Disabling canonical plugin in k2 2.10.2 not working.

  • zamarza1
  • zamarza1's Avatar Topic Author
  • Offline
  • Junior Member
More
5 days 9 hours ago #174419 by zamarza1
zamarza1 created the topic: Disabling canonical plugin in k2 2.10.2 not working.
Hi,

I was facing a problem with my multilangual website (English and French) for several days.
The two home menus had canonical urls which is not allowed for SEO. I read that it can be very bad for my SEO. So I tried to figured out the problem.

First, I thought the problem was in SH404SEF. They found it was not the case.

Then, I thought it was in JSiteMap Pro. John Daglemore found it was not the case.
But he found that disabling canonical URL in K2 settings was not working.

He proposed me a hack.
In the file root/components/com_k2/views/item/view.html.php at line 757 I added 'return;' to solve my problem.
private function setCanonicalUrl($url)
{
return;
$document = JFactory::getDocument();
$params = K2HelperUtilities::getParams('com_k2');
$canonicalURL = $params->get('canonicalURL', 'relative');
if ($canonicalURL == 'absolute') {
$url = substr(str_replace(JUri::root(true), '', JUri::root(false)), 0, -1).$url;
}
$document->addHeadLink($url, 'canonical', 'rel');
}

Now it works. The SEO error has disappeared.
I know that it is not the right solution. Maybe there is a bug.
Please would you investigate the problem?

Thanks for your help
Amar Guillen

Please Log in or Create an account to join the conversation.

  • Fotis
  • Fotis's Avatar
  • Offline
  • Administrator
  • JoomlaWorks Support Team
More
5 days 39 minutes ago #174424 by Fotis
Fotis replied the topic: Disabling canonical plugin in k2 2.10.2 not working.
Good catch. This was obviously a bug and it's been fixed in K2 v2.10.3 (dev) which you can safely upgrade to from: getk2.org/downloads/?f=K2_Development_Release.zip

If you use & love K2, please take a moment to add your review and rate it
at the Joomla Extensions Directory: extensions.joomla.org/extension/k2/


IMPORTANT: Please search the forum before posting a question!

JoomlaWorks Support Team Member

Please Log in or Create an account to join the conversation.

  • zamarza1
  • zamarza1's Avatar Topic Author
  • Offline
  • Junior Member
More
4 days 17 hours ago #174430 by zamarza1
zamarza1 replied the topic: Disabling canonical plugin in k2 2.10.2 not working.
Hi Fotis,

thank you very much for the update. It works perfectly. It is a great news.
I got a lot pages disappeared because the SEO problem generated by the bug.

Thanks for all
And because it is never too late, I wish you a happy new year.

Amar Guillen

Please Log in or Create an account to join the conversation.

  • Fotis
  • Fotis's Avatar
  • Offline
  • Administrator
  • JoomlaWorks Support Team
More
3 days 19 hours ago #174445 by Fotis
Fotis replied the topic: Disabling canonical plugin in k2 2.10.2 not working.
Happy new year to you too Amar :)

Keep in mind that you can still use canonical URLs even for multilingual sites. According to Google webmasters.googleblog.com/2011/12/new-markup-for-multilingual-content.html it just requires some additional meta tags.

Since I have a new plugin in the works for multilingual associations in K2, I will make sure to add these as well.

If you use & love K2, please take a moment to add your review and rate it
at the Joomla Extensions Directory: extensions.joomla.org/extension/k2/


IMPORTANT: Please search the forum before posting a question!

JoomlaWorks Support Team Member

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum