Canonical Link to Pligg Site

By | April 30, 2014

Canonical links is that links which you want to say to the search engines and to Google that is your main link of your site and you want to crawl only this links,so like this you disable the dublicate links of your site.

For example if you do not have the correct canonical link on your meta tags to your pligg site then Google maybe can crawl 2 same links like:

the site .com/ and www. the site .com

so that links with the www. or with out the www.  are same links.So with the canonical link meta tag you just ask to Google to crawl only the one link with the www. (or with out the www.)of your site.

Same issue is also to the story links ,we say that because the pligg 2.0.0 and up didn’t have that meta tag code for canonicals,so your site can crawl 2 same links at any given time.. so here is the canonical meta tag code which you need to add to your pligg site in order to stop the duplicate links.

For Pligg 2.0.0 and up you need to add the below code as it is to your  “meta.tpl” page on the end of the code of the file and before the “<!–/meta.tpl –>”

{if $pagename eq ‘published’}<link rel=”canonical” href=”{$my_base_url}{$my_pligg_base}/{if $urlmethod==2}{if $get.page>1}{$request_category}/page/2/{else}{$request_category}/{/if}{else}{if $get.page>1}?page={$get.page}&category={$request_category}{else}?category={$request_category}{/if}{/if}” />{/if}
{if $pagename eq ‘index’}<link rel=”canonical” href=”{$my_base_url}{$my_pligg_base}” />{/if}
{if $pagename eq ‘story’}<link rel=”canonical” href=”{$my_base_url}{$my_pligg_base}{$navbar_where.link2}” />{/if}

The canonical issue is also same on the oldest pligg 1.2.2 version,but this code is already there,but you need now to open the “pligg.tpl” file and need just one change to slash (/) to the end of the index link,so replace the code you see there with this code:

{if $pagename eq ‘published’}<link rel=”canonical” href=”{$my_base_url}{$my_pligg_base}/{if $urlmethod==2}{if $get.page>1}{$request_category}/page/2/{else}{$request_category}/{/if}{else}{if $get.page>1}?page={$get.page}&category={$request_category}{else}?category={$request_category}{/if}{/if}” />{/if}
{if $pagename eq ‘index’}<link rel=”canonical” href=”{$my_base_url}{$my_pligg_base}” />{/if}
{if $pagename eq ‘story’}<link rel=”canonical” href=”{$my_base_url}{$my_pligg_base}{$navbar_where.link2}” />{/if}

Incorrect canonical links on pligg site can be one more reason where google ban the bookmarking sites ,so by replace our code to your pligg sites help on the quality of your site.

By Ilektra Geronta

2,145 total views, 7 views today