I checked many different sites (official one also) and all the examples display the google snippets code itemscope/itemtype inside a div and the itemprop inside a span.
I'm wondering if this is just a simple way to show samples code or is the only way yo display it.
I have my address in a list so i wrote like this:
<li itemprop="address" itemscope itemtype="http://schema.org/PostalAddress">
<i class="fa fa-map-marker fa-lg"></i> <p class="labelSocial">Address:</p>
<a href="https://www.google.com/maps/place/Glogauer+Stra%C3%9Fe+21/#52.49226,13.4369,17z/data=!3m1!4b1!4m2!3m1!1s0x47a84fb24234006b:0x36dfe942fb2b5f97" target="_blank">
<p class="addressText">
<span itemprop="streetAddress"> Glougauerstrasse 21, </span> </br>
<span itemprop="postalCode"> 12435 </span>
<span itemprop="addressLocality"> - Berlin </span>
<span itemprop="addressCountry"> (DE) </span>
</p></a>
</li>
is that also correct?
Your Code is fine but you'll have to nest schema.org/PostalAddress under some main category but use of <li> tag is correct. Here is what Google Structured Data testing tools shows for the code you mentioned above-
http://www.google.com/webmasters/tools/richsnippets?q=uploaded:800501214b811a6b2bbfb52e2d77f96d
In order to tell Google and other search engines that address is related to what, we must specify a category and nest postal address inside it. Please see the example, schema.org/PostalAdsress is nested inside LocalBusiness schema:
<div itemscope itemtype="http://schema.org/LocalBusiness">
<h1><span itemprop="name">Beachwalk Beachwear & Giftware</span></h1>
<span itemprop="description"> A superb collection of fine gifts and clothing
to accent your stay in Mexico Beach.</span>
<div itemprop="address" itemscope itemtype="http://schema.org/PostalAddress">
<span itemprop="streetAddress">3102 Highway 98</span>
<span itemprop="addressLocality">Mexico Beach</span>,
<span itemprop="addressRegion">FL</span>
</div>
Phone: <span itemprop="telephone">850-648-4200</span>
</div>
Related
I have searched stackoverflow and the web and I can't find an direct answer to this question.
On my website I have added the schema information for the price of an item (see below)
<span itemprop="offers" itemscope itemtype="http://schema.org/Offer">
Adults and over 10 years old Presale– <span itemprop="price" content="10.00">
<span itemprop="priceCurrency" content="USD">
<span itemprop="availability">
<span itemprop="availabilityStarts" content="2017-01-01T00:00">
<span itemprop="availabilityEnds" content="2017-03-17T23:00">
<span itemprop="inventoryLevel" content="10000">
<span itemprop="url" content="http://www.website.com">
$10</span></span></span></span></span></span></span>
</span>
So as you can see, I have a TON of <span > code. I want to try and reduce this.
I have tested the validation of this snippet via W3C and it validated just fine.
What I am curious about is A) is there a better way, and B) can I just reduce to 1 <span> and include all of that in one so it would look like this:
<span itemprop="priceCurrency" content="USD">
<span itemprop="availability" itemprop="availabilityStarts" content="2017-01-01T00:00" itemprop="availabilityEnds" content="2017-03-17T23:00" itemprop="inventoryLevel" content="10000" itemprop="url" content="http://www.website.com">
Or am I trying to cram too much in one area?
In principle, what you did is fine. However, you currently list the itemprop and content attributes many times on this single <span> element. This is invalid HTML.
Instead, I recommend using data-* attributes.
<span data-price="10.00"
data-price-currency="USD"
data-availability="true"
data-availability-starts="2017-01-01T00:00"
data-availability-ends="2017-03-17T23:00"
data-inventory-level="10000"
data-url="http://www.example.com"></span>
Further reading: using data attributes.
I have added the necessary Schema markup for the JobPosting schema to my job board website. However, the rich snippets are not showing up in SERPs unlike one of my competitors.
Am I missing any mandatory fields?
I have checked the webmaster tools Structured Data tool and everything looks fine.
Here is an example screenshot:
Any helps greatly appreciated.
My URL: http://www.backpackerjobboard.com.au/jobs-in/sydney/
EDITED: acode snippet added
<ul class="jobs-list">
<li class="group" itemscope itemtype="http://schema.org/JobPosting">
<div class="inner">
<span class="status"><span>·</span> New</span>
<h3><span itemprop="title">Qualified Joiners and Cabinet Makers wanted Immediate start</span></h3>
<span class="company-name" itemprop="hiringOrganization" itemscope itemtype="http://schema.org/Organization"><span itemprop="name">NSW Joinery Pty Ltd</span></span>
<span class="location"><i class="icon"> </i>
<span itemprop="jobLocation" itemscope itemtype="http://schema.org/Place">
<span itemprop="address" itemscope itemtype="http://schema.org/PostalAddress">
<span itemprop="addressRegion">Sydney</span>
</span>
</span>
</span>
<span class="time-posted" itemprop="datePosted">Job posted: 21st November 2014</span>
</div>
<span class="category" itemprop="employmentType">Full-time</span>
</li>
...
</ul>
I'm improving the markup for the Products section of a site of mine by using Microdata. Everything is doing just fine, as the info is being showed in the Google results as expected.
But I think it would be nice to specify a category to a given product. I've searched everywhere and rode every attribute spec found in http://Schema.org/Product but it seems there is nothing there I can use to spec a "Category".
I tried to set itemprop="category" but Google's Rich Snippet Tool gives me this warn: "Page contains property "category" which is not part of the schema.", which is true.
Does anyone knows which property should I use to designate the Category for a Product? Any thoughts on this would be nice.
schema.org/Offer has category property.
A category for the item. Greater signs or slashes can be used to
informally indicate a category hierarchy.
So smth like that will work.
<div itemscope itemtype="http://schema.org/Product">
<span itemprop="name">Kenmore White 17" Microwave</span>
<img src="kenmore-microwave-17in.jpg" alt='Kenmore 17" Microwave' />
<div itemprop="aggregateRating"
itemscope itemtype="http://schema.org/AggregateRating">
Rated <span itemprop="ratingValue">3.5</span>/5
based on <span itemprop="reviewCount">11</span> customer reviews
</div>
<div itemprop="offers" itemscope itemtype="http://schema.org/Offer">
<span itemprop="price">$55.00</span>
<link itemprop="availability" href="http://schema.org/InStock" />In stock
<span itemprop="category">LargeCategory > SmallCategory</span>
</div>
</div>
OR
Another option is to use data-vocabulary.org which has category property in its Product class. OK for Google, NOT OK for other Search Engines though. But for Google it will work. Smth like that:
<div itemscope itemtype="http://data-vocabulary.org/Product">
<span itemprop="brand">ACME</span> <span itemprop="name">Executive
Anvil</span>
<img itemprop="image" src="anvil_executive.jpg" />
<span itemprop="description">Sleeker than ACME's Classic Anvil, the
Executive Anvil is perfect for the business traveler
looking for something to drop from a height.
</span>
Category: <span itemprop="category" content="Hardware > Tools > Anvils">Anvils</span>
Product #: <span itemprop="identifier" content="mpn:925872">
925872</span>
<span itemprop="review" itemscope itemtype="http://data-vocabulary.org/Review-aggregate">
<span itemprop="rating">4.4</span> stars, based on <span itemprop="count">89
</span> reviews
</span>
<span itemprop="offerDetails" itemscope itemtype="http://data-vocabulary.org/Offer">
Regular price: $179.99
<meta itemprop="currency" content="USD" />
$<span itemprop="price">119.99</span>
(Sale ends <time itemprop="priceValidUntil" datetime="2020-11-05">
5 November!</time>)
Available from: <span itemprop="seller">Executive Objects</span>
Condition: <span itemprop="condition" content="used">Previously owned,
in excellent condition</span>
<span itemprop="availability" content="in_stock">In stock! Order now!</span>
</span>
</div>
You can find out more about this vocabulary here.
I don't get it
On http://schema.org/Product there is category mentioned ( under brand ), still in https://developers.google.com/structured-data/testing-tool/ it apears as an error.
Have they added this attribute recently?
I would like to add microdata to a page, but the data for an item is broken up into a couple discontinuous parts of the page. If I have two span elements with an itemscope attribute, is it possible to get search engines to merge the two itemscopes and interpret them as a single item?
For example*:
<span itemscope itemtype="http://schema.org/Person">
Hello, my name is <span itemprop="name">Glinda</span>.
</span>
I like to fly around in a giant bubble.
<span itemscope itemtype="http://schema.org/Person">
I live in the <span itemprop="location">Land of Oz</span>.
</span>
Is there a way to add something like an itemid attribute to tell a web spider that the two Person itemscopes should be consumed as one item, instead of two?
Maybe something like this.
<span itemscope itemtype="http://schema.org/Person" itemid="7f6ba1">
Hello, my name is <span itemprop="name">Glinda</span>.
</span>
I like to fly around in a giant bubble.
<span itemscope itemtype="http://schema.org/Person" itemid="7f6ba1">
I live in the <span itemprop="location">Land of Oz</span>.
</span>
* I understand that in this example I could just use one big span, but I can't do that with the actual page I have to work with.
Edit: Perhaps I need a better example. It's a bit contrived, but demonstrates the problem I have. Remember, reorganizing the page is not an option.
<h1>Locations</h1>
<ul>
<li itemscope itemtype="http://schema.org/Person">
<span itemprop="name">Bob</span> lives in <span itemprop="location">Berkeley</span>
</li>
<li itemscope itemtype="http://schema.org/Person">
<span itemprop="name">Carol</span> lives in <span itemprop="location">Cupertino</span>
</li>
</ul>
<h1>Jobs</h1>
<ul>
<li itemscope itemtype="http://schema.org/Person">
<span itemprop="name">Bob</span> works at <span itemprop="affiliation">Borders</span>
</li>
<li itemscope itemtype="http://schema.org/Person">
<span itemprop="name">Carol</span> works at <span itemprop="affiliation">Capitol One</span>
</li>
<ul>
Is there a way to make this microdata result in two Person items, rather than four?
I want to have Bob, who lives in Berkeley, and works at Borders, and Carol who lives in Cupertino and works at Capitol One.
If I'm reading the W3 itemref properly, you can use the itemref property for this purpose:
<h1>Locations</h1>
<ul>
<li itemscope itemtype="http://schema.org/Person" itemref="bob">
<span itemprop="name">Bob</span> lives in
<span itemprop="homeLocation">Berkeley</span>
</li>
<li itemscope itemtype="http://schema.org/Person" itemref="carol">
<span itemprop="name">Carol</span> lives in
<span itemprop="homeLocation">Cupertino</span>
</li>
</ul>
<h1>Jobs</h1>
<ul>
<li itemprop="affiliation" itemscope itemtype="http://schema.org/Organization" id="bob">
Bob works at <span itemprop="name">Borders</span>
</li>
<li itemprop="affiliation" itemscope itemtype="http://schema.org/Organization" id="carol">
Carol works at <span itemprop="name">Capitol One</span>
</li>
<ul>
Yes it is possible if you use the itemref property.
Have a look at this website: IJzerfront 14-18
They link up the information (description and image are separated and are added to the Museum Place).
I have an address that is going to be displayed on a webpage, but it is not the address for the author of the page. How should this be coded to be semantic given the w3c recommendation of:
The ADDRESS element may be used by authors to supply contact information for a document or a major part of a document such as a form. This element often appears at the beginning or end of a document.
You could use the hCard Microformat to describe your address. The advantage of Microformats is that you can use them in your existing documents to enrich them.
Here’s an example derived from the example from the Microformats wiki:
<address class="vcard">
<span class="adr">
<span class="street-address">169 University Avenue</span>
<span class="locality">Palo Alto</span>,
<abbr class="region" title="California">CA</abbr>
<span class="postal-code">94301</span>
<span class="country-name">USA</span>
</span>
</address>
The answer by Gumbo is missing an ingredient. An hcard/vcard is required to have a name (fn).
http://microformats.org/wiki/hcard#Property_List
Also the address tag should not be used in this case as it is specifically used to relate to the author of the page it is displayed on.
<div class="vcard">
<span class="fn">Tristan Ginger</span>
<span class="adr">
<span class="street-address">169 University Avenue</span>
<span class="locality">Palo Alto</span>,
<abbr class="region" title="California">CA</abbr>
<span class="postal-code">94301</span>
<span class="country-name">USA</span>
</span>
</div>
Most business wanting to display their address on their website should use the following:
<address class="vcard">
<span class="fn org">Tristan Ginger Inc</span>
<span class="adr">
<span class="street-address">69 University Avenue</span>
<span class="locality">Great Bookham</span>,
<span class="region">Surrey</span>
<span class="postal-code">KT22 9TQ</span>
<span class="country-name">UK</span>
</span>
</address>
you can use RDFa, eg:
<html
xmlns="http://www.w3.org/1999/xhtml"
xmlns:foaf="http://xmlns.com/foaf/0.1/"
xmlns:address="http://schemas.talis.com/2005/address/schema#"
xml:lang="fr" lang="fr"
>
<head>...</head>
<body>
<div typeof="foaf:Person" about="http://you.openid.com#me">
<span id="name" property="foaf:name">First Name, Last Name</span>
<address property="address:streetAddress">My Street, My City</address>
</div>
</body>
</html>
You can use the Schema.org vocabulary's PostalAddress item for this. It can be used via Microdata, RDFa, or JSON-LD.
For example, using RDFa:
<div vocab="http://schema.org/" typeof="PostalAddress">
<span property="name">Google Inc.</span>
P.O. Box<span property="postOfficeBoxNumber">1234</span>
<span property="addressLocality">Mountain View</span>,
<span property="addressRegion">CA</span>
<span property="postalCode">94043</span>
<span property="addressCountry">United States</span>
</div>
AFAIK, this should also be valid with <address> in place of the enclosing <div>:
<address vocab="http://schema.org/" typeof="PostalAddress">
<span property="name">Google Inc.</span>
P.O. Box<span property="postOfficeBoxNumber">1234</span>
<span property="addressLocality">Mountain View</span>,
<span property="addressRegion">CA</span>
<span property="postalCode">94043</span>
<span property="addressCountry">United States</span>
</address>