Create Local Business Rich Snippet

I thought it would be nice to right out a little how to on a recent task I did for a site I manage (www.mrdscarpetcleaning.com).  Rich Snippets are a bit of a new thing when it comes to SEO and running a small business.  There are tons of different snippets and snippet variations that can be found on http://schema.org/.  For right now I am only going to show a local business.

The first part that will be looked for by the search engine is the itemscope and itemtype attributes.  This is going to basically tell the search engine this is a snippet and also what kind.  For a local business it is as follows.

<div itemscope itemtype="http://schema.org/LocalBusiness">

From here on out we build out the snippet with the name address.  Take note that there is actually a second snippet in here that is denoted by the itemtype=”http://schema.org/PostalAddress” attribute.

<span itemprop="name">Mr. D's Carpet Cleaning</span>
<div itemprop="address" itemscope temtype="http://schema.org/PostalAddress">
     <span itemprop="streetAddress">731 N 25th St.</span>
     <span itemprop="addressLocality">Mesa</span>,
     <span itemprop="addressRegion">AZ</span>
     <span itemprop="postalCode">85213</span>
</div>

The last part for this snippet will be including the contact information.  You can add the phone number and the website for your small business.

Phone: <span itemprop="telephone">(480) 628-3788</span><br />
Website: <a style="color: black;" itemprop="URL">http://www.mrdscarpetcleaning.com/</a>

Now, if we put this all together you will get a full rich snippet for your local business.  Take a look at the following.

<div itemscope itemtype="http://schema.org/LocalBusiness">
     <span itemprop="name">Mr. D's Carpet Cleaning</span>
     <div itemprop="address" itemscope itemtype="http://schema.org/PostalAddress">
          <span itemprop="streetAddress">731 N 25th St.</span>
          <span itemprop="addressLocality">Mesa</span>,
          <span itemprop="addressRegion">AZ</span>
          <span itemprop="postalCode">85213</span>
     </div>
     Phone: <span itemprop="telephone">(480) 628-3788</span><br />     
     Website: <a style="color: black;" itemprop="URL">http://www.mrdscarpetcleaning.com/</a>
</div>

One side note to keep in mind.  If you run your site through html validators make sure that it handles HTML5 tags.  As you can see in the example the itemscope attribute doesn’t have a value after it as it’s a Boolean value it does not need anything after it in HTML5.  If you can’t change the version and your validator is saying this is invalid you can update your attribute to:

<div itemscope="itemscope" itemtype="http://schema.org/LocalBusiness">

By setting it to itself you are in a sense tricking the validator to say that this value is true.


Leave a Reply

Your email address will not be published. Required fields are marked *

StackOverflow Profile