2. Call schema_org_markup() In Your Header

Open up the header.php file for your child theme and find the html tag, usually towards the top. You’ll want to call the schema_org_markup function inside that html tag, like so:

<html <?php schema_org_markup(); ?> <?php language_attributes(); ?>>

3. Create a WooCommerce template file in your child theme

Create a directory in your child theme folder named woocommerce. Inside the woocommerce folder, create another new folder named single-product. Inside the single-product folder, create a file named price.php. The contents of your price.php file should look like this:

4. All Done

If you run into any issues or it doesn’t seem to be working for you, let me know. I’ve only tested this with two themes, Vantage and Virtue. Remember, this only works with well-crafted WordPress themes. Doing this with purchased themes from ThemeForest or other paid theme marketplaces can be significantly more difficult.

Comments are open so let me know if you have any issues, additions, questions, or suggestions.

2+

Well, now what?

Work with Me

I'm available for hire and always taking new clients, big and small. Got a project or an idea you'd like to discuss? Startup plan but no developer to make it happen? Just get in touch, I'd love to see if I can help you out!

Leave some Feedback

Got a question or some updated information releavant to this post? Please, leave a comment! The comments are a great way to get help, I read them all and reply to nearly every comment. Let's talk. 😀

Like this:

Related

Published by Tyler Longren

Hi! I'm Tyler Longren, a freelance web developer. I'm a father to two beautiful daughters and a car stereo enthusiast.
I like PHP, JavaScript, WordPress, Git, HTML5 & CSS3, and other neat things. I really love the open source community, too.
You can find me on twitter or Google+, and Github.
This is my personal blog and that's it!
View all posts by Tyler Longren

Hi Tyler, great article, one of only a few out there so thank you. I have added the above code to my Woocommerce site which is using WooThemes Canvas theme but for some reason the itemtype for all my test products is being set to ‘Article’ rather than ‘Product’. Category and Shop pages are being set to correctly Product itemtype. Example product url is http://www littletigertest co uk/product/les-papoum-elephant-soft-toy-moulin-roty-copy/

I’ll have a major revision ready within a few weeks hopefully that will let you fill woocommerce with all the microdata you could want (that may be a bit of an exaggeration, but I’ll be taking feature requests).

Glad it was useful and definitely be interested to see what developments are in the wind. I’m looking at how to incorporate in volume discount data (max/min price) and multi-currency information based on the Aelia currency switcher plugin so got a bit list of “would be nice” to incorporate in..

Absolutely. There’s no plugin I can recommend for WPEC. I’d be willing to develop something. I’d need access to a demo WPEC site though for testing, would just make things so much faster if I didn’t have to setup WPEC with products and everything.

Do you happen to have a site using WPEC that I could have access to? Or would you be willing to set one up?

Tyler. Thanks for this information as it is very informative. I have a small question. I currently have a site that is using WooCommerce and the theme from WooThemes seems to have most of the schema.org product tags. However, it does not have “itemcondition”. Is there as way you can think of that I can simply add only the itemcondition schema?7.27 New

Hi, many thanks for the easy walk through! I am getting an error from Google Webmaster though as all my category pages are being marked up as ‘product’ pages with no name. I’m using the Storefront theme. Any ideas what needs to be changed? Thanks, Iain

I found your blog through woocommerce, and their post about selling digital goods.
If you could help me solve a problem, or suggest a solution, it would be amazing.

I have a website built on WordPress, and Woocommerce.
It sells a digital / printed magazine. Whihc means, that the same magazine issue can be bought in printed and online versions.
But, we want to sell the digital version in “Zinio” format”, which means, that the licence a person bought, would allow them to read the magazine online, on their pc, laptop, smartphone, tablet, without dowloading it to their computer. To prevent them from sharing the pdf file of the magazine.

I’d like to display our products as Rich Cards on Googles search result pages but for that you need more structured data. My products are missing the values for “brand” and the “MPN”. Do you know a solution how to echo such values when you use an additional product attribute “brand” in Woocommerce?
Here you find more informations about the markup for rich cards: https://developers.google.com/search/docs/guides/search-gallery