Jump to content

Duplicate Meta description in webmaster even when canonical 301 redirects is activated in Prestashop


sarfaraz.r1406

Recommended Posts

Hi,

 

We are getting duplicate meta description in webmaster tools for dynamically fetched pages.

Lets say we have 48 products in one category.

 

Category URL:

www.example.com/6/vegetables

 

In the first version of the page we allow 24 products. Remaining products are showcased in the next page with below(where page-2 is dynamically generated) URL

www.example.com/6/vegetables/#/page-2

 

Problem Statement:

 

Now, google bots are considering these two pages as different pages. But these two pages are all together same page according to us. Overall 301 redirect for canonicalization is already implemented for this scenario in overall application.

 

Expected Solution:

 

1. How to remove this error in webmaster?

 

Concerns:

 

1. Does this error will hamper the SEO of my application?

 

 

Thanks in advance :)

post-777241-0-51277200-1442045870_thumb.png

Edited by sarfaraz.r1406 (see edit history)
Link to comment
Share on other sites

  • 1 month later...

I solved the problem somehow by adding the following lines in my header.tpl file.

{if $page_name == category}
   <link rel="canonical" href="{$base_dir}{$request_uri|substr:1}" />
{/if}
 
This solved my problem as when browsing my url is something like this:
 
But in webmasters tools, google says it found duplicate meta description for the following pages:
 
But for this link the canonical url doesn't work. My query is why google crawls this url when it can never be obtained by simple browsing?
Link to comment
Share on other sites

  • 2 years later...
<meta charset="utf-8" />
<title>{if $p != 1 and $page_name == 'category'}({$p})- {l s='Страница'} {/if}{if $p != 1 and $page_name == 'new-products'}({$p})- {l s='Страница'} {/if}{if $p != 1 and $page_name == 'prices-drop'}({$p})- {l s='Страница'} {/if}{if $page_name == 'product'}{l s='Купить'} {$product->name|escape:'html':'UTF-8'} - Название магазина ✓ {$product->reference|escape:'html':'UTF-8'}{else}{$meta_title|escape:'html':'UTF-8'}{/if}</title>
<meta name="description" content="{if $p != 1 and $page_name == 'category'}({$p})- {l s='Страница'} {/if}{if $page_name == 'product'}{l s='Купить'} {$product->name|escape:'html':'UTF-8'}{l s=' ➨ в магазине Название магазина ✓'} {else} {$meta_description|escape:'html':'UTF-8'}{/if}" />

 :) 

God bless the author of this code))

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...