-
AuthorPosts
-
September 6, 2017 at 4:27 pm #1060808
Hi, JA K2 filter is producing hundreds of duplicated URL like this:
site.com/menuitem/?category_id=22&isc=0&limit=12&limitstart=0
why there is no canonical on these pages pointing to the main filter menu item? i don’t need Google to index and make these searches new URL that is basically duplicated.
by the way, on the main menu item there is a canonical i set up with sh404sef, it is not showing on the search results tho….Please advise…Luna Garden ModeratorLuna Garden
- Join date:
- July 2011
- Posts:
- 2617
- Downloads:
- 80
- Uploads:
- 96
- Thanks:
- 78
- Thanked:
- 453 times in 425 posts
September 8, 2017 at 4:08 am #1061129September 13, 2017 at 4:39 pm #1061875This reply has been marked as private.September 19, 2017 at 9:25 pm #1062970anyone?
Anonymous ModeratorJA Developer
- Join date:
- September 2014
- Posts:
- 9914
- Downloads:
- 207
- Uploads:
- 152
- Thanks:
- 1789
- Thanked:
- 2008 times in 1700 posts
September 22, 2017 at 12:17 am #1063401Do you understand that this is a major problem for ALL your customers who use this????
it created hundreds if not thousands of duplicated URLs that are not friendly URLs and that don’t even have a canonical tag!! This is a recipe for Google penalty and a disaster for anyone’s website!
Please show this post to your superiors and tell them that it is a top priority and a MUST fix…I personally will not except this filter the way if it’s not fixed…after all the hard work I did to set it up I will have to find another one 🙁Mr.Cat ModeratorMr.Cat
- Join date:
- December 2016
- Posts:
- 270
- Downloads:
- 24
- Uploads:
- 69
- Thanks:
- 58
- Thanked:
- 53 times in 50 posts
September 22, 2017 at 6:50 am #1063479Here is the code that add canonical tag to each filter page. Open file
/components/com_jak2filter/views/itemlist/view.html.php
Add this to line 553
$url = $uri->toString(array('scheme', 'host', 'path')); $customTag = '<link rel="canonical" href="'.$url.'" />'; $document->addCustomTag($customTag);
If it works as you execpected, let us know. So we can include it to the next update 🙂
ThanksWisdom is not a product of schooling but of the lifelong attempt to acquire it.
September 23, 2017 at 8:54 pm #1063652Yea, it works. Please make it for the next version so I will not lose the code.
also, can we also add rel="next" & rel="prev"? can we put that too on the pagination links?Mr.Cat ModeratorMr.Cat
- Join date:
- December 2016
- Posts:
- 270
- Downloads:
- 24
- Uploads:
- 69
- Thanks:
- 58
- Thanked:
- 53 times in 50 posts
September 25, 2017 at 2:24 am #1063748Yes, we can. Just use this block code. Do the same as my previous post
// add canonical, prev, next rel $url = $uri->toString(array('scheme', 'host', 'path')); $canonical = '<link rel="canonical" href="'.$url.'" />'; $document->addCustomTag($canonical); $pdata = $pagination->getData(); if ($pdata->previous->link) { $pre = '<link rel="prev" href="'.$uri->toString(array('scheme', 'host')) . $pdata->previous->link.'" />'; $document->addCustomTag($pre); } if ($pdata->next->link) { $next = '<link rel="next" href="'.$uri->toString(array('scheme', 'host')) . $pdata->next->link.'" />'; $document->addCustomTag($next); }
Don’t forget to let us know if it works 🙂
Wisdom is not a product of schooling but of the lifelong attempt to acquire it.
September 25, 2017 at 6:50 pm #1064003from your latest code, canonical is showing but not the new code (rel="next" ect…)
Mr.Cat ModeratorMr.Cat
- Join date:
- December 2016
- Posts:
- 270
- Downloads:
- 24
- Uploads:
- 69
- Thanks:
- 58
- Thanked:
- 53 times in 50 posts
September 26, 2017 at 2:28 pm #1064202This reply has been marked as private.Mr.Cat ModeratorMr.Cat
- Join date:
- December 2016
- Posts:
- 270
- Downloads:
- 24
- Uploads:
- 69
- Thanks:
- 58
- Thanked:
- 53 times in 50 posts
September 27, 2017 at 2:49 am #1064284The code is working now. You can check the source of this url
September 27, 2017 at 9:26 am #1064424ok thanks, so all this code will be included in the next version update? it seems that the filter is not working on joomla 3.8, when is the update coming out?
Mr.Cat ModeratorMr.Cat
- Join date:
- December 2016
- Posts:
- 270
- Downloads:
- 24
- Uploads:
- 69
- Thanks:
- 58
- Thanked:
- 53 times in 50 posts
AuthorPostsViewing 15 posts - 1 through 15 (of 15 total)This topic contains 14 replies, has 4 voices, and was last updated by Mr.Cat 7 years, 2 months ago.
We moved to new unified forum. Please post all new support queries in our New Forum
canonical tag
Viewing 15 posts - 1 through 15 (of 15 total)