Victor CIobanu

Back-end Developer

Front-end Developer


Internet of Things

Victor CIobanu

Back-end Developer

Front-end Developer


Internet of Things

Blog Post

WooCommerce free Google Product Feed

January 2, 2013 diy

This tutorial will teach you how to create a Google product feed (for Google merchant center) using the products you have on your WordPress WooComerce store platform . You will be able to add the products from your woocommerce store to Google merchant centre, and have full control over the category of products they will appear on.

This tutorial is for all the people that do not want to purchase the Google Product Feed Plugin , from the WooCommerce store (or think that 50$ is a bit to much).
Free WordPress Plugin for Google Merchant

Getting products into google merchant

I will split this article into 3 sections :

  • Store Product feed Case study
  • Implementation
  • Further support

1. Store Product feed Case study
I had to design for a German client ( an online store. They specialize in LED lighting solutions, so their products have a lot of technical specifications. Being used to wordpress, I decided to try to go for a ecomerce plugin that had the latest seo bells and whistles (microdata/rich snippets) so I went for woocommerce.
After all was set and done with the store, I realized that for the German market, pushes a lot of “shopping results” right into the result page.Google recomends products on certain searches It’s the same with United States, Brazil, Canada, Italy, UK, Spain and a few more countries that for the sake of keeping this short I will not mention them here :). (my home country, Romania, is not one of them).
List of countries supported by google merchant

So what does this really mean ? Well it means that soon Google will show you results and prices from various “respected” stores or retailers, each time you search for a particular brand or product. Trying to always stay on the edge of SEO and Google’s crazy ideas (Google wave comes to mind) I decided to give Google Merchant a chance.
Getting your products into google merchant
My first question was how do I get “my store” listed there. The solution was simple enough, you just have to open an account. Everything is free as long as you are not from United State. (they need to pay in order to get their products shown in the result, but I have a feeling that soon enough we will all need to)
Product feed url
After I got my account id I was presented with an option to add a “new data feed”. After selecting my target country the format (googlebase) and a random data feed filename, I was left with a lot more questions than answers, like :

What format does the Google merchant data feed needs to be ?

It can be txt or XML (rss2 or atom) but I found that XML (RSS2) was the easiest to set up with the woocommerce store platform.

What information does the product feed need to contain ?
You will find additional information here : but keep in mind this is for an English store only !
There are country specific variables like ‘in stock’ is ‘auf lager’ for a German store, so you might need to consult your own version of that help file.
Keep in mind that Google_product_category and product_type are super case sensitive and MUST be chosen from a predefined list compiled by Google !

It’s a long list but here it goes :
id [id] – An identifier of the item
title [title] – Title of the item
description [description] – Description of the item
Google product category [Google_product_category] – Google’s category of the item
product type [product_type] – Your category of the item
link [link] – URL directly linking to your item’s page on your website
image link [image_link] – URL of an image of the item
additional image link [additional_image_link] – Additional URLs of images of the item
condition [condition] – Condition or state of the item
availability [availability] – Availability status of the item
price [price] – Price of the item
sale price [sale_price] – Advertised sale price of the item
sale price effective date [sale_price_effective_date] – Date range during which the item is on sale
brand [brand] – Brand of the item
gtin [gtin] – Global Trade Item Number (GTIN) of the item
mpn [mpn] – Manufacturer Part Number (MPN) of the item

Most of the data can be extracted from the Woocomerce store platform. (considering that you entered the information in the store)

2. Implementation of the woocommerce product feed

It’s pretty simple and straight forward :

a. You need to create your product feed and add some rewrite rules. For that you will need to add this to your theme “functions.php” file :

//Define the product feed php page
function products_feed_rss2() {
 $rss_template = get_template_directory() . '/product-feed.php';
 load_template ( $rss_template );
//Add the product feed RSS
add_action('do_feed_products', 'products_feed_rss2', 10, 1);

//Update the Rerewrite rules
add_action('init', 'my_add_product_feed');
//function to add the rewrite rules
function my_rewrite_product_rules( $wp_rewrite ) {
 $new_rules = array(
 'feed/(.+)' => 'index.php?feed='.$wp_rewrite->preg_index(1)
 $wp_rewrite->rules = $new_rules + $wp_rewrite->rules;
//add the rewrite rule
function my_add_product_feed( ) {
 global $wp_rewrite;
 add_action('generate_rewrite_rules', 'my_rewrite_product_rules');

Notice the “/product-feed.php” , you can change that to whatever you want as long as the file you will be using will have that name.

b. Create or upload a file called “product-feed.php” that has the folowing code in it : product-feed.php

'; ?>


    <?php bloginfo_rss('name'); wp_title_rss(); ?>
    Lichtschl?uche Lichterketten
     'product', 'posts_per_page' => 999 );
    $loop = new WP_Query( $args );
    while ( $loop->have_posts() ) : $loop->the_post(); global $product;
        <?php the_title_rss() ?>
        price ?>
        is_in_stock() ? 'auf lager' : 'vorbestellt'; ?>
		Heim & Garten > Beleuchtung > Leuchtmittel > LED-Leuchtmittel
        Heim & Garten > Beleuchtung > Leuchtmittel > LED-Leuchtmittel
		get_sku(); ?>





Keep in mind that this product feed code was custom made for a German client (led shop) so you will need to change some things around like :

Lichtschl?uche Lichterketten 
 is_in_stock() ? 'auf lager' : 'vorbestellt'; ?> 
Heim & Garten > Beleuchtung > Leuchtmittel > LED-Leuchtmittel
 Heim & Garten > Beleuchtung > Leuchtmittel > LED-Leuchtmittel

description – it can be anything
condition – you must use the proper variables for your specific country (example for English: new, used
availability – you must use the proper variables for your own country (for English:in stock, out of stock)
brand – the brand of the product
product_type – Important ! use only the Google specified product categories that you can find here
Google_product_category– Important ! same as above

c. Access your product feed by adding going to http://yourStore/feed/products/
d. Specify the link to your product feed in your Google merchant account and on your webmaster tools under submit sitemap.
Products are in the google merchant center with no errors
e. You are all done. It may take up to 4 days for your products to appear (given there are no errors in the submission) in the Google products results.

3. Further support
To lazy to implement the woocommerce product feed by yourself

I will offer free advice and reply to your questions related to this article.
If you are unable to implement this free tutorial on how to get your woocommerce products listed in Google products, or you find this time consuming, I will do it for your, for a nominal fee of 25$ (just think of all the things you could do with that money, get a domain name for two years, feed a family of 5 ants for a whole year, get a half-decent host for 1 month, so don’t be lazy, don’t give me the money, I’ll probably use them to buy 5 packs of cigarettes that will last me exactly 3 days… ) :P

PayPal logo

For the time being I will only work on English/German product feeds. After you acquire my services I will contact you via email within 24 hours and either work remotely using a program of your choice or just set the files up for uploading and guide you step by step on how to submit the product feed.
I will issue a full refund :
– If my schedule is too full and I am unable to contact you within 48 hours.
– If for some strage reason I am unable to get the feed working
– If you are unpleased with the results
– If I don’t like you
– If you don’t like me :)
I have started working on a wordpress plugin that I will offer free of charge (donation ware) but I do not have an estimate on when it will be completed.
(I’m a SEO guy, and I chose SEO because I’m lazy so…)


UPDATE 03.01.2013 thanks to Taye from Iphone 5 Adapter
Server issues while accesing the rss product feed for google merchant
NOTE ! Some servers (hosts) might not return the proper answer when requesting a feed
example returns a 404. you need to ask your web-hosting company if it’s possible to return a proper header during such a request.

You can test if your server is affected by this issue by going to filling in your domain name and adding /feed at the end. if you get a Status: HTTP/1.1 404 Not Found , you will not be able to submit your feed to google merchant. It does not matter if you can access it in your browser (it will show up on chrome), you will not be able to submit the feed.

A simple solution would be to go to your by using google chrome as a browser, right-click, view source, and save the content of the source to a file, rename that file to products.xml and upload it to your domain root.

You can then use the file to insert your products into google merchant or just chose Manual upload and select the file you just created.

Keep in mind that this is not a real solution, since when you either change the prices, or add a new product, you will need to repeat the procedure. The real solution is checking with the server administrator of hosting for support. (just tell them that you need the server to issue a proper response whenever someone requests a rss feed)

UPDATE 31.01.2013 Thanks to Jane There might be some issues with maya woocmerce theme. Before giving up try testing with another theme. Use this as a reference. DO NOT DEPLOY the theme commercially as it is a premium theme. (the guy who designed it might come after you (in your sleep :P ) if he finds out.

UPDATE 11.02.2013 Thanks to John; If you experience issues with the maya theme (or other themes) related to the fact that the product feed is not accessible it can be one of two possible issues :
1. You can’t access the yourdomain.tld/feed/products/ in any browser (you get a 404)
FIX : you need to turn on permalinks in your wordpress install (under settings -> permalinks -> post name)

2. You can access the yourdomain.tld/feed/products/ in chrome but you can’t submit it to google merchant or access it in any other browser (you get a 404 response)
FIX : you need to post a “post” in wordpress, so that the rss feed system gets activated/generated. do that and your theme will issue the proper response (200) when your product feed is called upon by google merchant.

Update 14.02.2013 Finally had the time to write a plugin, you can download it free here Free Woocommerce Product Feed Plugin

  • Taye 1:08 am January 3, 2013


    WOuld you be able to help implement this on this site? ?


  • Victor Ciobanu 1:34 am January 3, 2013

    100% yes. It looks like you are using mearishop theme. the only issue we would have would be related to shipping. if you offer free shipping on all products then it’s super easy to set up. if you offer a weight based shipping then you would need to add the weight for those particular products in the backend for each product. if it’s size based shipping then it’s a little bit harder (not impossible thou) to implement.
    I’ve set up a ‘somewhat’ customized file for your site here
    If you still need my help (or would like me to implement it for you, let me know)
    Cheers mate.

    • Taye 3:48 am January 3, 2013

      Hi Victor,

      Thanks for your prompt response. I still want you to help implement it. How do I proceed? I will go ahead and make payment now via PayPal.


  • Taye 3:50 am January 3, 2013

    By the way, I am offering free shipping for UK customers but will charge european and rest of the world customers.

    • Victor Ciobanu 4:03 am January 3, 2013

      hey, thanks :D you are my first customer :) looks like 2013 will be a nice year :) I’ve sent you an email with my skype id. we can either do this by skype or any means of live chat, ( voice or not).

  • Sherryayn 7:29 am January 5, 2013

    I have been looking for something like this for so long! It’s worth the $25 for you to do it so I don’t mess my site up.

    I’m about to click “Buy Now!” Thanks again –s

    • Sherryayn 7:44 am January 5, 2013

      I tried to email you but it didn’t go through. Send me an email when you get a chance?

      • Victor Ciobanu 7:58 am January 5, 2013

        Just did :) on the paypal email thou, and i forwarded it to the one you used here to comment; Just making sure you don’t think it’s a scam or anything :)

    • Victor Ciobanu 7:59 am January 5, 2013

      Glad you did, sent you an email. We will have it running by the end of the day 100%

  • Simon 11:45 am January 7, 2013

    Hey, thanks for the tutorial. I tried to set this up on however I get an error as you can see. Can you offer any help?

    • Victor Ciobanu 2:10 am January 14, 2013

      To see Simon’s products listed on google shopping just follow this link

      His advice was completely free as he had already done most of the work and was just stuck at some syntax issues. He seemed to be a nice and polite guy and i was more than happy to help him . All i asked of him was a facebook like… and i think i got it :D

  • Victor Ciobanu 11:54 am January 7, 2013

    hey Simon, make sure that you remove the !– from the product-feed.php file. I had to put those so the syntax would show correctly on the site.

  • Sherryayn 8:21 pm January 7, 2013

    You’re amazing Victor! I checked this morning and all my products are approved and active!

    Thanks so much for your help, you’re so fast and know this stuff inside and out. It was hands down the best money I’ve ever spent.

    • Victor Ciobanu 10:43 am January 8, 2013

      I’m super happy i could help :) the minute i’ll get some free time, i’ll try to help you with some other advices .

      To see Sherryan’s products listed in google products visit this like (you might even find some honda parts that you need :P )

  • paul 9:15 pm January 14, 2013

    Hi Victor, Great piece of code and exactly what I was looking for thank you. Only one question, do you have cleaner up version of the code? I’ve spent the last hour trying to clear up the syntax but i’m only up to line 34.

    • Victor Ciobanu 9:47 pm January 14, 2013

      Glad i could help , you can use this as a reference

      Hope this helps you

    • paul 9:56 pm January 14, 2013

      Wow, that was a very quick reply, Thank you very much Victor a very nice piece of code, and saves $50 on the official woothemes extension (Which really should have been included by default)

  • Wouter van Maaren 10:25 pm January 21, 2013


    This really is wonderful! but on the moment not working for me. There seems to be a syntax error on line 13. I think it”s the <?php="" part. Can you maybe check what is wrong?



  • Kelly 10:59 am January 22, 2013

    I’m getting a 301 redirect when I navigate to the feed/products directory. Thoughts?

    • Victor Ciobanu 7:00 pm January 22, 2013

      yes. you are not using permalinks on your wordpress install.

  • Peter 11:00 pm January 22, 2013

    Hi Victor, thanks a lot for this code! We have some products in our shop that are entered without a price, just for listing purposes. We get error messages for those because the price is missing – is there a way to exclude them?

    • Victor Ciobanu 11:10 pm January 22, 2013

      Hi Peter, In theory, google merchant will exclude those by default, so you should not worry about that issue. Since my solution uses the integrated wordpress rss feed system, I can’t think of any “out-of-the-box” quick solutions (other than enforcing a set of theme function rules for those particular posts(products))

      • Peter 1:40 pm January 23, 2013

        Ok, thanks Victor, I could import all other products successfully so it’s no big deal. Thanks again for your code!

  • Jane 1:27 am January 31, 2013


    Thank you very much!

    I have followed the instructions and have added the code. As per you update, I have experienced 404 header status for and have contacted the hosting company who have told me that is a wordpress issue and not a server issue. After googling around I have found that many similar questions on WP forums, but no solutions. Could you please guide me in a right direction? I am not sure how to resolve this…

    • Victor Ciobanu 8:32 am January 31, 2013

      Just checked your feed, I used google chome browser, and the feed showed up as it should. Then I tried it in firefox, and nothing happens (no page is displayed). At this time I only have two and a half “solutions” :

      0. You try using another woocommercetheme (other than maya) just to check if that is the problem. Here is the download link to a test theme. Please do not deploy this theme commercially (on the final version of the site) as it is a paid template.

      1. (using google chome browser) You either copy the source of the created feed by right clicking and selecting view source, to a new file called whaterver.xml and submit that file to google merchant

      2. You try setting up your site on a different server (i can provide you with a free temporary account on one of my servers if you don’t have a backup host)
      I have hosting servers in Germany, US, Romania and Nederlands with configurations ranging from linux/windows apache/nginx/lightspeed mysql/mariadb/postgreSQL and after i’ve done the proper server setup , i managed to get the proper response on all of them. In this way you will know for a fact if it’s time to change the host (they are to lazy to do the changes needed for your site) or it’s a template/wordpress issue.

      • Jane 12:25 am February 3, 2013

        Thank you!!

  • R Appadoo 2:17 am January 31, 2013

    could you help me to implement this code to my website please?
    I have added the first codes at the top of my theme “functions.php” file and then created “product-feed.php” in my theme’s folder (same folder as functions.php), inputted the second code and made the necessary changes.
    However I get a blank page when i try to navigate to the feed. My website is

    • Victor Ciobanu 8:41 am January 31, 2013

      Love the site and the merch btw :P
      I’ve added you on facebook. Send me a message today 31.01.2013, and we could try to see what’s wrong.

  • rhaffaele 2:24 pm February 4, 2013

    can you help to resolve this situation
    in my demo site work fine

    • Victor Ciobanu 4:33 pm February 4, 2013

      Sure, I’m currently finishing project. I’ll get back to you at around 20.00 (gmt+1), and we can try to fix it.

      • rhaffaele 9:21 pm February 4, 2013

        tnx, i resolved by my self
        but now i have got some other question
        is possible to insert brand from WooCommerce Product Brands extension?

        • rhaffaele 9:22 pm February 4, 2013

          product_brand ?> i try this code but dont work

          • rhaffaele 9:23 pm February 4, 2013

            product_brand ?>

          • rhaffaele 1:41 am February 5, 2013

            something like a custum field named brand can bee a solution?

  • rhaffaele 5:00 pm February 4, 2013

    ok, tnx

  • John 11:10 pm February 7, 2013

    Hey there,

    First off, thanks for making this tutorial!

    I’m using mayashop and am getting a parse error on line 11 of product-feed.php. Is this the normal error with mayashop/do you know of anything I can do to fix it?

    I haven’t tried it with another theme yet because I’m new to WordPress and am somewhat worried about breaking the site.

    Thanks again!

    • John 2:34 am February 11, 2013

      Nevermind, I missed some of the html comments.

      Thanks for this though. You saved me $50 and taught me something!

      • Victor Ciobanu 1:04 pm February 11, 2013

        Sorry, I was away this weekend, so i never got to help you/read your message. I’m happy that you managed to fix it by yourself :) (you might be new to wordpress but you are definitely not new to coding :P) Glad i could provide you with the building blocks to make your product feed run.

        • John 5:41 pm February 11, 2013

          I may have a fix to one of the mayashop issues with the google product feed.

          I ended up getting 404 response codes from the server even though I could see the XML document at

          The solution was to publish a post in wordpress. I had everything set up as pages and 0 actual posts. I guess because of the lack of posts, the wordpress rss functionality was a little screwy?

          • Victor Ciobanu 6:38 pm February 11, 2013

            Oau ! John, there’s no other way to put this, except, YOU ROCK !
            I’ve spent the better part of a day, trying to debug maya theme, in order to figure out why i was getting a 404 when trying to access the feed. I never figured it out, so i either advised people to change the theme (this issue is maya particular) or to “dump” the content of the xml (you can access it in chrome) and use that file (the “dump”) for the merchant account product feed. It never ever crossed my mind, the fact that if you never “post” a post under maya the rss never gets “active” (thus sending a proper 200 response when called).
            I will post an update, asap
            Cheers, and thank you for the great feedback , this is why i wrote the post to begin with (so that people would start helping each other)

  • Alex 2:32 pm February 13, 2013

    With Atahualpa Theme this plugin doesn’t work.

    I have this error:

    Warning: require_once(/home/mhd-01/…/htdocs/wp-content/themes/atahualpa/product-feed.php) [function.require-once]: failed to open stream: No such file or directory in /home/mhd-01/…/htdocs/wp-includes/template.php on line 405

    Fatal error: require_once() [function.require]: Failed opening required ‘/home/mhd-01/…/htdocs/wp-content/themes/atahualpa/product-feed.php’ (include_path=’./:/usr/share/php/’) in /home/mhd-01/…/htdocs/wp-includes/template.php on line 405

    I have saved product-feed.php in the same folder of functions.php (theme folder).

    How can I fix this error?


    • Victor Ciobanu 5:00 pm February 13, 2013

      Hi Alex,
      I currently working on a plugin, I should be ready by the end of the day with it :)
      You did something wrong… i can’t set you in the right direction at this time, but I’ll get back to you once the plugin is ready .

    • Spike Patching 11:43 am June 23, 2014

      You need to upload the product-feed.php file to the theme folder NOT the public_html folder

  • glenn 7:05 pm March 9, 2013

    Hi Victor

    Great plugin, thanks! I seem to have it all working fine – apart from one thing – the shipping. I offer free shipping worldwide on every product so should be easy. But the feed doesn’t pick this 0.00 up anywhere so I am getting this error message:

    “Shipping is missing. Please specify in the ‘shipping’ attribute or in your account settings with a default shipping method selected for each targeted country. Note: Allow 15 minutes for account settings to take effect before uploading a new feed. Learn more.

    My products still seem to be submitted but it says all of them have an error as no shipping is defined. Any ideas? Thanks in advance for the help.


    • Victor Ciobanu 7:22 pm March 9, 2013

      here’s what I would do, I would set up shipping in the merchant account to free shipping, or, i would set weight to my products (the weight is sent to google merchant) and then establish a set of rules in shipping. Here is an example – in merchant account under setting – tax and shipping – Merchant account shipping settings

  • erhan 8:06 pm April 16, 2013

    hi i have installed and activated your product feed.

    when i visit this link:

    i get this error report:

    Index of /feed/products

    Parent Directory
    Apache/2.2.23 (Unix) mod_ssl/2.2.23 OpenSSL/0.9.8e-fips-rhel5 mod_bwlimited/1.4 mod_qos/10.10 mod_perl/2.0.6 Perl/v5.8.8 Server at Port 80

    can you tell me what is wrong here?


    • Victor Ciobanu 8:26 pm April 16, 2013


      please enable permalinks on your site. It should work just fine after that.

      in wp-admin go to setting->permalinks->custom structure /%postname%/

      Let me know how it goes

  • erhan 9:22 am April 17, 2013


    he does not take: /%postname%/

    as custom structure

  • erhan 9:23 am April 17, 2013

    do i need to create the folder feed and products by ftp?

  • erhan 9:34 am April 17, 2013

    Hi i need another urgend help.

    your plugin do not works with product variation. here you have one product but with many variation:

    in word press you have to write the different article-no of each product in the variation option.

    can you solve this problem in your plugin.

    that is the reason why many products of me arent in google shopping.

  • erhan 12:30 pm April 19, 2013

    Hi Victor.

    can you help me please?

  • Boris 7:49 am May 2, 2013

    You Just Awesome!

  • Dave OSullivan 10:24 pm December 5, 2013

    Hi, I have clicked buy it now and purchased your services but the email on paypal keeps bouncing back. Please can you email me with the info you require to
    Many thanks, Dave OSullivan

    • Victor Ciobanu 6:29 am December 8, 2013

      Hi Dave, I’ll be with you today at around 7 pm GMT.

  • Denise 10:01 am April 11, 2014

    Hi Victor,

    First of all thx for sharing your solution with the community :)

    I have one question though before I try to do this myself: Does this still work if your site has multiple brands & google product types/categories as it seems that in product-feed.php you are defining fixed values?

    brand – the brand of the product
    product_type – Important ! use only the Google specified product categories that you can find here
    Google_product_category- Important ! same as above



  • Lara 3:39 am May 28, 2014

    Don’t know if you still read this but need help with inserting a gtin field and having it fetch the attribute isbn data.

  • Steven Noe 1:51 am June 5, 2014


    Awesome! Thanks. Say, is the feed exclusive to the Google Merchant Centre? We need the same functionality for a remarketing agency (LiquidAds), but WP’s RSS feed does not contain images or product IDs, as you know.

    Seems like we could adopt this for that purpose, do you agree?


  • Josh 5:51 am June 30, 2014


    Ive been trying to solve an issue with a conflict between thew plugin and WooCommerce 2.1

    Seemings they are using script generated pages for order received ect, for some reason the plugin makes these pages 404 error. Is there an update that fixes this?

    Thanks for the great free plugin!

  • Erhan 11:41 am October 16, 2014

    Hi Victor,

    my feed reader can not read the feed on my website. Can you help me please. See here:

    where is the mistake? What is wrong? how can i fix it.

    i would be glad if you can help me.


Comments are closed.