Jump to content

Rich snippet - remove <p> </p> from Description


kadapawn

Recommended Posts

Hello guys,

 

I have a small problem with snippet display on my website.

 

When i test this product on google snippet testing tool, i get this result

 

The error i think is becouse of the </p> <p> tags...

 

Can anybody advice on how to remove that string from product.tpl?

 

I am using prestashop 1.5.6 and a custom theme. I have addshoppers and yotpo modules active.

 

Note that string_tags was not working on my testing.

 

Regards,

Eroare: This information will not appear as a rich snippet in search results, because it is contained in a hidden HTML element. Except in special circumstances, Google won't display content that is not visible to the user. You should mark up the text that actually appears to your users when they visit your web pages.

 

Link to comment
Share on other sites

this is my snippet code at the bottom of product.tpl and i see no change with |strip_tags added..

<div itemscope itemtype="http://schema.org/Product" style="display:none;">
    <div itemprop="name">{$product->name|escape:'htmlall':'UTF-8'}</div>
    <div itemprop="description">{$product->description_short|strip_tags|escape:'htmlall':'UTF-8'}</div>
    <img itemprop="image" src="{$link->getImageLink($product->link_rewrite, $cover.id_image, 'large')}"/>
    <div itemprop="offers" itemscope itemtype="http://schema.org/Offer">
        <span itemprop="price">{convertPrice price=$productPrice}</span>
    </div>
</div>

Link to comment
Share on other sites

Hello kadapawn,

 

I am sorry to tell you that you did wrong : adding the schema.org schema at the end of the page and hidding it is not the way it works.

 

The <p> elements in the description are not the problem.

 

As you can read on the error message :

This information will not appear as a rich snippet in search results, because it is contained in a hidden HTML element 

 

You have to deploy the itemtype, itemscope and itemprop directly on the existing code. Don't add it at the end and hide it.

 

For instance, you should add the itemtype and itemscope for Product on the #center_column and itemprop "name" on your <h1>.

 

Using microdata schema is about structuring your current code, not adding stuff at the end of the page to generate some richsnippets on Google.

 

Hope it helps,

Best regards,

Ciseur

 

 

Link to comment
Share on other sites

  • 8 months later...

i have added like this

 

<!-- left infos-->

 

<div id="pb-left-column">

<h1>{$product->name|escape:'htmlall':'UTF-8'}

<div itemscope itemtype="http://schema.org/Product" style="display:white;">

<div itemprop="name">{$product->name|escape:'htmlall':'UTF-8'}</div>

<div itemprop="description">{$product->description_short|strip_tags|escape:'htmlall':'UTF-8'}</div>

<img itemprop="image" src="{$link->getImageLink($product->link_rewrite, $cover.id_image, 'large')}"/>

<div itemprop="offers" itemscope itemtype="http://schema.org/Offer">

<span itemprop="price">{convertPrice price=$productPrice}</span>

</div>

</div>

</h1>

 

 

you get that error becouse of style="display:none i've changed it to style="display:white;" and error dissapeard. 

Edited by tashkas (see edit history)
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...