How to use dateModified microdata - schema

I have written a schema tag that is showing a warning "The property dateModified is not recognized by Google for an object of type Date" in Google Structured Data Testing tool. Below is my code:
<div itemscope="" itemtype="http://schema.org/Date">
<meta itemprop="dateModified" content="2018-06-07">
How will I fix this warning?

This dateModified property can only be used with http://schema.org/CreativeWork or http://schema.org/DataFeedItem.
The problem with your code is that you're telling Google that the type of this item you're marking up is of the type Date, and then giving it a property (dateModified) it does not support.
To fix this, you'd have to do:
<div itemscope="" itemtype="http://schema.org/CreativeWork">
<meta itemprop="dateModified" content="2018-06-07">
</div>
Notice I only changed Date to CreativeWork.

Related

Is there a way to declare undefined or empty property value with Schema Microdata?

I'm building structured data for basics website and I often have missing mandatory property.
Is there a syntax to pass "undefined" or empty as a valid property with Microdata syntax ?
Exemple, i have an old blog article and I have no date linked, so i would put :
<meta itemprop="datePublished" content="">
<meta itemprop="dateModified" content="">
But this is invalid for Schema debug app :
Is there a specific way to tell "I dont't have this information, that's not an error" with Microdata ?

Schema warning about QAPage on Question type

I have a page with multiple Question and Answers and I'm getting the following warning on each question:
Missing a QAPage markup item on page to which this item should be associated.
This is example markup:
<div itemscope="" itemtype="http://schema.org/Question">
<h3 class="question" itemprop="name text">This is the question?</h3>
<div class="answer" id="IdForTheAnswer" itemprop="acceptedAnswer" itemscope="" itemtype="http://schema.org/Answer">
<div itemprop="text">
<p>This is the answer text.</p>
</div>
</div>
</div>
And below is the example warning from https://search.google.com/structured-data/testing-tool/ :
Question | 0 ERRORS | 1 WARNING
#type
- Question
- name
- This is the question?
- text
- This is the question?
- acceptedAnswer
- #type
- Answer
- #id
- https://www.example.com/IdForTheAnswer
- text
- This is the answer text.
warning
- Missing a QAPage markup item on page to which this item should be associated.
What is this warning actually asking me to provide?
What I've tried unsuccessfully so far:
Remove the id from the acceptedAnswer
Use suggestedAnswer instead of acceptedAnswer
Provide the Question with a mainEntityOfPage
Ok so after an entire day of trying I finally stumbled on the answer.
I was getting that same warning if I removed everything but the question item, so it's something related to that. I tried a lot of things and on a hunch I ended up wrapping the whole collection of questions in this:
<div itemscope itemtype="http://schema.org/FAQPage">
<!-- Rest of Q&A markup -->
</div>
And now I get valid schema without any errors or warnings.
I feel like the documentation and error messages are not very good, or I just don't understand this ecosystem and its resources yet!
p.s. I also tried the QAPage itemtype but that requires a lot more props and doesn't actually describe the page I'm building, so FAQPage comes closest.

Fixing "The property order is not recognised by Google for an object of type Product" without changing core code in PrestaShop

I use PrestaShop and I don’t want to change any of the core code. The core code allows for a price in Schema.org. My prices have a low price and discount amount also. Low price is from aggregate offer and discount is from order.
I get the error below:
The property order is not recognised by Google for an object of type Product
<link itemprop="discount" itemscope href="http://schema.org/Order"/>
&
<link itemprop="highPrice" itemscope href="http://schema.org/AggregateOffer"/>
<p class="our_price_display" itemprop="offers" itemscope itemtype="http://schema.org/Offer"><link itemprop="availability" href="http://schema.org/InStock"/><span id="our_price_display" itemprop="price">€ 0.75</span> <meta itemprop="priceCurrency" content="EUR" /></p><p id="reduction_percent" ><span id="reduction_percent_display" ><link itemprop="discount" itemscope href="http://schema.org/Order"/>25% Off </span>
</p><p id="reduction_amount" ><span id="reduction_amount_display">
</span></p><p id="old_price"><span id="old_price_display">
<link itemprop="highPrice" itemscope href="http://schema.org/AggregateOffer"/> € 1.00</span>
You can't just use the discount from Order for a Product (since a product is not an order...) is what Google is saying. Like the schema.org spec for Order says:
An order is a confirmation of a transaction (a receipt), which can contain multiple line items, each represented by an Offer that has been accepted by the customer.
I'm not aware of any other property like "discount" in Schema, maybe http://schema.org/PriceSpecification is sort of that direction?

What's wrong with my structure data?

It's been more than 4 months that our rich snippets suddenly disappeared, some error were reported in GWT, i corrected everything and errors are now decreasing (only 5 left). here is my code:
<section class="c-center" itemscope itemtype="http://schema.org/Product">
<div>
<h1><span itemprop="name">Product name</span> <span itemprop="brand" class="brand">Brand of product</span></h1>
<div id="reviews" itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating">
<div class="rating">
<meta itemprop="ratingValue" content="4.8" />
<meta itemprop="ratingCount" content="56" />
<div class="fill" style="width:96%"></div>
<div class="stars"></div>
</div>
<div class="rating-info">
Based on 56 reviews - Write a review
</div>
</div>
</div>
<div id="img">
<img src="/link-to-image.jpg" alt="Img alt" itemprop="image" />
</div>
<div id="info">
<meta itemprop="url" content="site.com/link-of-product/">
<div id="price-container" itemprop="offers" itemscope itemtype="http://schema.org/Offer">
<meta itemprop="priceCurrency" content="EUR">
<meta itemprop="gtin13" content="1234567899999">
<span class="price" itemprop="price">19,95 €</span> <del>28,50 €</del> -
<span class="stock"><link itemprop="availability" href="http://schema.org/InStock">Available</span>
</div>
</div>
</section>
here are my questions:
1- is there anything wrong?
2- I've seen in many posts that currency should not be in the itemprop="price" but in google examples, they do include it! what should I do?
3- should I use ratingCount or reviewCount ?
4- some products exist in different sizes with different prices, is it recommended to include the AggregateOffer with lowest and highest price?
Thanks a lot
How does it appear visually?
The structured data linter shows a typical snippet which looks good and has star rating, and there are no errors in google's tool. Two things which stand out are:
url has no protocol, set to http://yoursite.com/page1 for
price should be number only, which could well be affecting search results, currency is a separate field so should not be embedded in price as well
use <meta> to give your price with a full stop as the separator, not the comma and put large values as 1234567.89 not 1,234,567.89 or 1.234.567,89 but display it as you would normally
price info from http://schema.org/
Use the priceCurrency property (with ISO 4217 codes e.g. "USD") instead of including ambiguous symbols such as '$' in the value.
Use '.' (Unicode 'FULL STOP' (U+002E)) rather than ',' to indicate a decimal point. Avoid using these symbols as a readability separator.
Note that both RDFa and Microdata syntax allow the use of a "content=" attribute for publishing simple machine-readable values alongside more human-friendly formatting.
Use values from 0123456789 (Unicode 'DIGIT ZERO' (U+0030) to 'DIGIT NINE' (U+0039)) rather than superficially similiar Unicode symbols.
google actually gives this example in its policies page
<span itemprop="priceCurrency" content="USD">$</span><span itemprop="price">119.99</</span>
previous Offer price, you could include in <del> structured data for the expired Offer price, with priceValidUntil set to a date in the past, the current price can also have an expiry date.
consider setting itemCondition to http://schema.org/NewCondition
image urls - I've noticed that full url starting path rather than a relative path seem to be preferred - your /link-to-image.jpg is interpreted as http://example.com/link-to-image.jpg not http://site. com/link-to-image.jpg in the testing tool, I'm unsure if this is the same when testing direct from the URL but it seems best not to be amigous
lastly use a shopping search tool, including google shopping to search for a best seller, see if it can find it by price, brand, availability etc. if competitor sites appear first you can even check the structured data tester with their URL to see if you are missing anything

facebook comment system using smarty and prestashop

I'm trying to add some comments box to a specific page of my website
but I met some trouble
using smarty I've seen in the documentation that in order to get the current url we should use that synthax {$smarty.server.HTTP_HOST}{$smarty.server.REQUEST_URI}
that's actualy what I did putting that code in my tpl.
{literal}
<div id="fcbcfooter"><div data-href="http://{$smarty.server.HTTP_HOST}
{$smarty.server.HTTP_HOST}{$smarty.server.REQUEST_URI}" class="fb-
comments" data-width="500px;" data-num-posts="10" data-
colorscheme="light"></div>
{/literal}
The trouble I have is that it return to me that message
href URL is not properly formatted
The code for getting url does not seems to be interpreted in the source code.
anykind of help will be much appreciated.
You are missing a closing </div> at the end of your code block right before the {/literal} tag.
{literal}
<div id="fcbcfooter">
<div data-href="http://{/literal}{$smarty.server.HTTP_HOST}
{$smarty.server.HTTP_HOST}{$smarty.server.REQUEST_URI}{literal}" class="fb-comments" data-width="500px;" data-num-posts="10" data-colorscheme="light"></div>
</div>
{/literal}