AdWords is now Google Ads. Our new name reflects the full range of advertising options we offer across Search, Display, YouTube, and more. Learn more

Ads
1.7K members online now
1.7K members online now
For questions related to Google Shopping and Merchant Center. Learn to optimize your Shopping ads
Guide Me
star_border
Reply

Schema.org Microdata <span itemprop> data is printing to page

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

Hi,

I have the microdata for the merchant center on my pages, and  there are no microdata errors reported in Google Merchant Center or in the Structured Data Testing tool... so that's great!

However, I have a problem, the code is printing text of two bits of microdata to the page, under and to the left of the 'add to cart' button... for example on this item;
www.arka-shop.co.uk/acatalog/Silver-Tribal-Earrings--Afghan-Dotwork-Design-EARSI23-EARSI23.html

It is printing the 'Product name' and 'Price', these are data in <span itemprop> tags.
(The other data in the <meta itemprop> tags is not visible, as I imagine it all should be.)

Does anyone know why the micordata tag code is printing the Product name and Price to the page, and how I can stop that happening?
The code is in the <body> of the page code.

The code I am using is the following;

<!-- microdata start -->
 <div itemscope itemtype="http://schema.org/Product">
    <span itemprop="name"><actinic:variable name="ProductName" /></span>
    <meta property="url" content="<actinic:block php="true">echo '<actinic:variable name="CatalogURL" encoding="perl" selectable="false" />' . basename('<actinic:variable name="ProductPageName" encoding="perl" selectable="false" />');</actinic:block>" />
    <meta itemprop="image" content="<actinic:variable name="CatalogURL" /><actinic:variable name="ProductImageFilenameRaw" />" />
    <meta itemprop="name" content="<actinic:variable name="ProductName" />" />
    <meta itemprop="productID" content="mpn:<actinic:variable name="ProductReference" />"/>
    <div itemprop="offers" itemscope itemtype="http://schema.org/Offer">
      <meta itemprop="priceCurrency" content="GBP" />£
      <span itemprop="price"><actinic:block php="true">echo preg_replace('/[^\d\.]/', '', '<actinic:block type="pricelist"><actinic:block if="%3cactinic%3avariable%20name%3d%22ListIndex%22%20%2f%3e%20%3d%3d%201"><actinic:variable name="TaxInclusivePrice" selectable="false" /></actinic:block></actinic:block>');</actinic:block></span>
      <meta itemprop="itemCondition" itemtype="http://schema.org/OfferItemCondition" content="http://schema.org/NewCondition"/>
      <meta itemprop="availability" content="http://schema.org/InStock"/>
     </div>
  </div>
<!-- microdata end -->

Re: Schema.org Microdata <span itemprop> data is printing to page

Visitor ✭ ✭ ✭
# 2
Visitor ✭ ✭ ✭

Ok... this may have been just a schoolboy error!
I think it is because I used <span> tags that they printed the content of the span.
I changed it to <meta itemprop> and the text disappeared, and it still passes the Structured data testing tool

<!-- microdata start -->
 <div itemscope itemtype="http://schema.org/Product">
    <meta itemprop="url" content="<actinic:block php="true">echo '<actinic:variable name="CatalogURL" encoding="perl" selectable="false" />' . basename('<actinic:variable name="ProductPageName" encoding="perl" selectable="false" />');</actinic:block>" />
    <meta itemprop="image" content="<actinic:variable name="CatalogURL" /><actinic:variable name="ProductImageFilenameRaw" />" />
    <meta itemprop="name" content="<actinic:variable name="ProductName" />" />
    <meta itemprop="productID" content="mpn:<actinic:variable name="ProductReference" />"/>
    <div itemprop="offers" itemscope itemtype="http://schema.org/Offer">
      <meta itemprop="priceCurrency" content="GBP" />
      <meta itemprop="price" content="<actinic:block php="true">echo preg_replace('/[^\d\.]/', '', '<actinic:block type="pricelist"><actinic:block if="%3cactinic%3avariable%20name%3d%22ListIndex%22%20%2f%3e%20%3d%3d%201"><actinic:variable name="TaxInclusivePrice" selectable="false" /></actinic:block></actinic:block>');</actinic:block>" />
      <meta itemprop="itemCondition" itemtype="http://schema.org/OfferItemCondition" content="http://schema.org/NewCondition"/>
      <meta itemprop="availability" content="http://schema.org/InStock"/>
     </div>
  </div>
<!-- microdata end -->