Beginner's Guide for WordPress - Start your WordPress Blog in minutes.
Choosing the Best
WordPress Hosting
How to Easily
Install WordPress
Recommended
WordPress Plugins
View all Guides

How to Add Rich Contact Information in WordPress

Last updated on by
Elegant Themes
How to Add Rich Contact Information in WordPress

Web search engines like Google or Bing are trying to pull more and more semantic from the content of the websites they index every day. Specific markups like microdata and microformats have been created to help search engines understand the meaning of your content. Search engines utilize this data to provide additional information on the search results page. Having rich snippets in search has shown to improve click through rate. In this article, we will show you how to easily add rich contact information in your WordPress site, so they can be displayed as rich snippets in the search results.

What are rich snippets for contact?

You may have already seen these rich snippets without even knowing. It adds relevant contact data like address, city, phone number, etc below the description when a website appears in search results page. Here is an example:

Rich Snippet Contact Information

Why should I care?

That’s a good question. Rich snippets can be a great help to show that your content is relevant to the user’s search query. It can increase the CTR (Click Through Rate) of your page in the search results. This is also a great way to stand out against your competitors on your selected keywords. Often local small businesses are behind the curve, so if you are one of the savvy small business owners, then make sure to implement this technique on your site.

How to add rich contact information in WordPress

We will take a look at two methods to insert rich contact information on your WordPress site. One will require a plugin, and the other would be the hard coded method.

Method 1 : with the Rich Contact Widget plugin

The easiest way is by using the Rich Contact Widget plugin. After installing and activating the plugin, go to Appearance » Widgets submenu. You will be able to add the Rich Contact widget in one of the widget areas of your theme. Fill out all your contact information, and let this plugin take care of the required markup for rich snippets.

Additionally, you can display an image map of your location, and provide a download link for a vCard containing your contact data. These are just options for your website visitors, and can be deactivated in the widget configuration.

Method 2: Hard coded in your theme

This method requires to edit your WordPress theme files, where you want the contact information to display. The example below will show you how to add both microdata and microformats, but you can use only one of them (microdata is the recommended one by Google).

<ul class="vcard" itemscope itemtype="http://schema.org/Corporation">
<li class="fn  org" itemprop="name"><strong>Your company name</strong></li>
<li itemprop="description">Your activity</li>
<ul class="adr" itemprop="address" itemscope itemtype="http://schema.org/PostalAddress">
<li class="street-address" itemprop="streetAddress">Your address</li>
<li><span class="locality" itemprop="addressLocality">City</span>&nbsp;<span class="region" itemprop="addressRegion">State</span>&nbsp;<span class="postal-code" itemprop="postalCode">Zip Code</span></li>
<li class="country-name" itemprop="addressCountry">Country</li>
</ul>
<li class="tel" itemprop="telephone">Your phone number</li>
<li class="email" itemprop="email"><a href="<?php antispambot( 'youremail@example.com' ) ?>">youremail@example.com</a></li>
</ul>

Microformats uses the class attributes to markup the data, while microdata uses itemtype and itemprop attributes. Detailed information for microdata markup can be found on the schema.org website, same for microformats with the hCard markup.

You can also see there is a function called antispambot() used in this code. It’s a WordPress specific function to protect your email address from spam bots crawling the web. A non-well know function but it is very useful.

Testing for structured data on your website

After utilizing one of the methods above, search engines will be able to get rich snippets data from your website. You can test it on this page by Google. Enter the url you want to preview, and all the structured data extracted will be displayed.

Rich Snippet Tool Verification

And you are done, search engines will now be able to pull rich information data from your website, and after a while it should display on the search results pages. Feel free to comment for any suggestions or questions.


Editorial Staff at WPBeginner is a team of WordPress lovers led by Syed Balkhi. Page maintained by Syed Balkhi.

WPBeginner's Video Icon
Our HD-Quality tutorial videos for WordPress Beginners will teach you how to use WordPress to create and manage your own website in about an hour. Get started now »
  • jorge perez

    Can I create one different for each page? I am a beauty salon, for the “hair extensions” page can I create a different one than the one for “hair color” page?
    thank you
    jorge

    • http://www.wpbeginner.com Editorial Staff

      Sure you can. Use a plugin like Widget Logic for that.

  • Vicente

    It seems that Google does not support this type of rich snippets … This message appears when I check:

    Warning: This information will not appear as a rich snippet in search results, because it seems to describe an organization. Google does not currently display organization information in rich snippets

    It’s a shame but anyway I’m going to keep my data visible. Thank you very much for teaching me to do this.

    Regards

  • Matt

    Is it possible to pull from a wordpress admin or user info?

    Seems like that would ensure consistancy.

    • http://www.wpbeginner.com Editorial Staff

      Last we checked, address and information like this is not stored in user meta. Also, your address shouldn’t change based on each user. This is more for small businesses.

  • David

    Thanks for the information. I will give it a try on my site.

  • Diogo Gomes

    Great Tutorial!

    On Method 2: how can we add our photo?

    Thanks

  • William (Web Actually)

    Hi ! Thanks for this article, really usefull. Must it be displayed on all page of the website ? Or just one page will generate the rich snippet for all the website ?

    • http://www.wpbeginner.com Editorial Staff

      Only the pages that contains this post will generate the rich snippets.

  • Brad Dalton

    Syd

    For SEO purposes, where would be the best position on your site to display your contact information?

    Would the footer be a better location rather than a contact or about page as this would display on all pages?

    • http://www.wpbeginner.com Editorial Staff

      Yes, you can display it wherever you like. Footer, sidebar, or even in your header.