The websites that we build are full of data about people, places, products and more. As designers we work very hard to present data to our users in an easily comprehensible and aesthetically pleasing way. However what we often don’t do is consider how easily our non-human counterparts (computers) can read and make sense of the data within our web pages. This is where using microdata can help be helpful.
Microdata aims to popularize a standardized way of marking up the structured data within our web pages so that it can be easily parsed by computer programs. This is acheived through the use of a few new HTML attributes and whole selection of schemas. These schemas describe all the properties that an item can have. The item here being defined as a thing such as a person, place, event or product.
In this blog post you are going to learn how to use the new microdata attributes as well as taking a look at some popular schemas from Schema.org.
Contents
Introducing Schema.org
It is all well and good spending time marking up the data within our web pages but if everyone is not using a standardized set of schemas we haven’t solved the problem of making this data more accessible. This is where Schema.org comes in.
Schema.org is a collaborative project between Bing, Google, Yahoo! and Yandex that aims to outline a set of standardized schemas that can be used by web developers in order to overcome the problem outlined above. You don’t necessarily have to use these schemas but I would strongly recommend that you do.
Note: It is also possible to create your own schemas. This is out of the scope of this article but if you are interested I would recommend reading this HTML5 doctor article.
Microdata Attributes
Before we get stuck into schemas you first need to learn about the new attributes that are used to markup the data within your web pages.
itemscope
– This attribute should be placed on a HTML element that contains all of the data relating to an item. You do not need to specify a value for this attribute.
<div itemscope>...</div>
itemtype
– The itemtype attribute is used to markup what an item is. The value of this attribute should contain a URL to a schema that defines all of the properties that the item can have.
<div itemscope itemtype="http://schema.org/Person">...</div>
itemprop
– This attribute is used to markup an item property. The value of this attribute should contain the name of the property. The contents of the element will be used as the value for the property. In the case that an itemprop attribute is used on a link, the value of the href
attribute will be used. For <img>
elements, the value of the src
attribute is used.
<span itemprop="name">Matt West</span>
itemid
– This attribute can be used to specify a unique ID for the item. This could be something like the ISBN for a book. A computer program may use this ID to determine whether multiple microdata items refer to the same physical object.
<div itemscope itemtype="http://schema.org/Book" itemid="urn:isbn:978-1-907828-03-4"> ... </div>
itemref
– The itemref attribute allows you to add properties that are located outside of the scoped item element. This achieved by adding a standard element id
attribute to the element containing the property data, and then specifying this ID in the itemref attribute on the main HTML element that contains your item. An example of this usage can be found below.
<span id="my-name" itemprop="name">Matt West</span> <div itemscope itemtype="http://schema.org/Person" itemref="my-name"> ... </div>
Notice that the element outside of the item scope still uses an itemprop
attribute.
Now that you understand the attributes involved in marking up your structured data lets take a look at some commonly used schemas.
LocalBusiness
The first schema that you are going to look at is for marking up data about local businesses. This schema contains many properties, some which you will use more often than others. The most important properties that you will want to make sure that you cover are: name, description, address, telephone, email and url. You can find a full list of the properties in this schema here.
Here is some markup that uses the LocalBusiness schema.
<div itemscope itemtype="http://schema.org/LocalBusiness"> <p itemprop="name">Developer City</p> <div> <img itemprop="logo" src="logo.png" alt="Developer City Logo"> </div> <p itemprop="description"> Web Design and Development Services. </p> <div itemprop="address" itemscope itemtype="http://schema.org/PostalAddress"> <span itemprop="streetAddress">Seatons Business Centre, High Street</span> <span itemprop="addressLocality">Guilsborough</span> <span itemprop="addressRegion">Northamptonshire</span> <span itemprop="postalCode">NN6 8PU</span> </div> <p> Tel: <span itemprop="telephone">01604 749014</span> </p> <p> Email: <a href="mailto:matt.west@developercity.co.uk" itemprop="email">matt.west@developercity.co.uk</a> </p> <p> Web: <a href="http://developercity.co.uk" itemprop="url">http://developercity.co.uk</a> </p> </div>
Here is how this markup would be interpretted by a computer program. Notice how the address is parsed as a linked item as we have used the PostalAddress schema to markup the address data.
Item type: http://schema.org/localbusiness property: name: Developer City logo: http://www.example.com/logo.png description: Web Design and Development Services. address: Item 1 telephone: 01604 749014 email: matt.west@developercity.co.uk url: http://developercity.co.uk Item 1 type: http://schema.org/postaladdress property: streetaddress: Seatons Business Centre, High Street addresslocality: Guilsborough addressregion: Northamptonshire postalcode: NN6 8PU
Note: Developers at Google have developed a handy tool for testing out your microdata markup: Google Rich Snippets Tool.
Person
Possible applications for the Person schema would include user profile pages and social networking sites. This schema also has an exhaustive list of potential properties, the most prominent being: name, description, image, url, additionalName (middle name), address, birthDate, deathDate, email, givenName (first name), familyName (last name), telephone and jobTitle.
Check out the full schema for more properties.
The markup below shows how you could use the Person schema to markup data in your web pages.
<div itemscope itemtype="http://schema.org/Person"> <p> <span itemprop="name"><span itemprop="givenName">Matt</span> <span itemprop="familyName">West</span></span> </p> <img itemprop="image" src="mattwest.png" alt="A picture of Matt West"> <p> DOB: <span itemprop="birthDate">04/06/1992</span> </p> <p> Web: <a href="http://matt-west.com" itemprop="url">http://matt-west.com</a> </p> <p> Telephone: <span itemprop="telephone">01604 749014</span> </p> <div itemprop="address" itemscope itemtype="http://schema.org/PostalAddress"> <span itemprop="streetAddress">Seatons Business Centre, High Street</span> <span itemprop="addressLocality">Guilsborough</span> <span itemprop="addressRegion">Northamptonshire</span> <span itemprop="postalCode">NN6 8PU</span> </div> </div>
Try using the Google Rich Snippets Tool to see how this markup could be interpretted by a computer program. Simply copy and paste the markup above into the textarea.
Product
The final schema that you are going to look at is used for marking up product data. This can be really useful when building eCommerce websites.
The most commonly used properties in the Product schema are: name, description, image, url, model, color, brand and productID. You can find a full list here.
An example product can be found below.
<div itemscope itemtype="http://schema.org/Product"> <h1 itemprop="name">Hovercar 5000</h1> <img itemprop="image" src="hovercar.png" alt="Hovercar 5000"> <p itemprop="description"> Arrive at your destination in style with the new environmentally friendly Hovercar 5000. </p> <p> Brand: <span itemprop="brand">ACME Hovercars</span> </p> <p> Model: <span itemprop="model">5000B</span> </p> <p> Color: <span itemprop="color">Silver</span> </p> <p> Product ID: <span itemprop="productID">HV5000B</span> </p> </div>
Note: You can find a full list of schemas here.
Final Thoughts on Microdata
Using microdata correctly will help to make the data in your web pages more accessible to computer programs (like those used by search engines to analyze your web pages).
Whilst I think that microdata does have an important place in a web developers toolkit, it is worth noting that using microdata can add a considerable amount of markup to your web pages. Take a look at all those extra <span>
elements that were needed to help markup the data in the examples above. All this extra markup can have an impact on the readability of your code; making it harder to understand for people that might be working on a project with you. To minimise this problem I would recommend that you only use microdata to markup the most important data on the page.
Are you using microdata in your projects? Let us know in the comments.
Is it beneficial for SERP ?? If Yes then I will add on my Website.
2015年の新素材-新作!高品質 腕時計高品質の追求 超N品を良心価格で提供スーパーコピーブランドバッグ、財布、時計代引き専門店2015年人気最新品、新素材! には、ルイヴィトンコピー、シャネルコピー、グッチコピー、コーチコピー、ロレックスコピー、プラダコピー、ブルガリ財布コピーその他小物等、ブランド品、、ルイヴィトン、PRADA、Coach、GUCCI、CHANEL、BVLGARI、デュポン、ROLEX時針各種海外有名ブランド品を豊富に取り揃え、しかもお客様を第一と考えて、驚きの低価格で提供しております。税関の没収する商品は再度無料にして発送します。広大な客を歓迎して買います!3-6日にきっと引き渡す.スーパーコピーブランド時計
[url=http://www.gowatchs.com/brand-208.html]ブランドコピー時計大人気を海外激安通販専門店ロレックス、ブルガリ、フランク ミュラー、シャネル、カルティエ、オメガ、IWC、ルイヴィトン、オーデマ ピゲ、ブライトリング、グッチ、エルメス、パネライ、パテックフィリップ偽物(コピー商品)のブランドの腕時計の販売、通販。[/url]
ブランドN級品ブランドコピー 代引き,スーパーコピー時計,ブランドN級品,楽天コピーブランド,,偽物ブラン日本最大級の最高のスーパーコピーブランド財布激安代引き販売店,スーパーコピー時計の激安老舗.!国内No.1時計コピー工房,アフターサービスも自ら製造したスーパーコピー時計なので、技術力でお客様に安心のサポー トをご提供させて頂きます。スーパーコピー 代引きN品をご 購入の方は、こちらへ.弊社は正規品と同等品質のコピー品を低価で お客様に提供します!すべての商品は品質2年無料保証です。
[url=http://www.brandiwc.com/brand-5-copy-0.html]スーパーコピー、スーパーコピーブランド(N級品)激安通販専門店世界一流ブランドコピー 財布、スーパーコピー 商品、激安ブランドコピー 。 ヴィトンコピー 、 ミョウミョウコピー 、シャネルコピー 、エル メスコピー 品格安通販。商品は全て最高な材料 と優れた技術で造られて、正規と比べて、品質が無差別です!人気ブランド..[/url]
I was suggested this blog by my cousin. I’m not sure whether this post is written by him as no one else know such detailed about my trouble. You’re incredible! Thanks!|
Easy to generate, but where all the code should be included? My site was built in php. Thanks http://www.terralabs.us
What about use microdata for blog posts?
I’ve found these two tutorials:
http://www.w3resource.com/schema.org/Blog.php
http://demosthenes.info/blog/617/How-To-Add-Microdata-To-Your-Blog
But they show quite different examples!
Moreover in the second link he put the time property outside the header, that’s the opposite said in this other article:
http://html5doctor.com/designing-a-blog-with-html5/
What do you think about it?
Hi Matt,
we are trying at vibeshop.com to implement the structure data markup, but we are having some difficulties. How can we contact you for some help regarding this. You are welcome to call us as well to discuss this with you too.