SEO : what is microdata?

How to mark up your content using microdata

Note: I've omitted the "<" on all the code

1a. What's microdata?


Your web pages have an underlying meaning that people understand when they read the web pages. But search engines have a limited understanding of what is being discussed on those pages.

By adding additional tags to the HTML of your web pages—tags that say, "Hey search engine, this information describes this specific movie, or place, or person, or video"—you can help search engines and other applications better understand your content and display it in a useful, relevant way.

Microdata is a set of tags, introduced with HTML5, that allows you to do this.

1b. itemscope and itemtype

Let's start with a concrete example. Imagine you have a page about the movie Casablanca—a page with a link to a movie trailer, information about the director, and so on. Your HTML code might look something like this:

div>
h1>Casablanca /h1>
span>Director: James Cameron (born August 16, 1954) /span>
span>Classics /span>
a href="/../movies/Casablanca-theatrical-trailer.html">Trailer /a>
/div>


To begin, identify the section of the page that is "about" the movie Casablanca. To do this, add the itemscope element to the HTML tag that encloses information about the item, like this:

div itemscope>
h1>Casablanca /h1>
span>Director: James Cameron (born August 16, 1954)  /span>
span>Classics /span>
a href="/../movies/Casablanca-theatrical-trailer.html">Trailer /a>
/div>

By adding itemscope, you are specifying that the HTML contained in the  div>... /div> block is about a particular item.

But it's not all that helpful to specify that there is an item being discussed without specifying what kind of an item it is. You can specify the type of item using the itemtype attribute immediately after the itemscope.

div itemscope itemtype="http://bostonwebgroup.com/Movie">
h1>Casablanca /h1>
span>Director: James Cameron (born August 16, 1954) /span>
span>Classics /span>
a href="/../movies/Casablanca-theatrical-trailer.html">Trailer /a>
/div>


This specifies that the item contained in the div is in fact a Movie, as defined in the bostonwebgroup.com type hierarchy. Item types are provided as URLs, in this case http://bostonwebgroup.com/Movie.

That's what microdata can do for you if your looking for better or faster results.

You can also ad tags for things like date, time, location, and more.

Still think you can do your own SEO?  I'm proud of you.

All the rest of you, you know who to call ;)

 

  • PDF
  • Print
  • Write e-mail