Using WordPress to add items to Google Shopping

Here is how I managed to add blog posts of a certain tag or category to a feed that is then added to Google’s Merchant (Shopping) service.  See my items here.

  1. Add the Feed Wrangler plugin to your WordPress installation.
  2. Activate the plugin and add a feed called “itemsforsale”
  3. Go to http://www.yourblognamehere.com/?feed=itemsforsale It should be a blank document – not missing, just blank.  You may need to edit an old blog post and resave it to update the cache.
  4. Save this file to your computer but change the file from .txt to .php and open it for editing.
  5. If you want to use a tag or category other than “itemsforsale” on your blog posts change that on line 35.
    20091026153731
  6. Among the last dozen or so lines of code (lines 52-56 below) are some of the specific attributes that Google uses.  Using the same format as those lines (image_link, price, condition, weight, and quantity) add any other attributes you may need to use from this list.
    20091026153220
  7. Use your FTP program to copy the file to your theme directory… /wp-content/themes/your_theme/
  8. Make a test post in your blog.  Name your item and a brief description in the title.  Add more details in the post area.  Tag the post “itemsforsale” or whatever you set in step 5.  Then expand the “Custom Fields” section below your blog post editor.  Make custom fields for condition, price,  imagelink, etc.  Match the text you used after $key in step six above for the name of the custom field.  For this test item set values for the five attributes included in my template (except for weight they are all required by Google).  For future posts you do not need to recreate the custom field, just pick the field from the dropdown and enter the value.  Do only one item for now to make sure everything works.  Publish your item.
    20091026154728
  9. Go to http://www.yourblognamehere.com/?feed=itemsforsale again.  This time your test post should show up.  Save the page to your computer and make sure it is saved as an .xml file.
  10. Become a Google Merchant.
  11. Make a new feed in Google Merchant.  Data feed type is googlebase.  Data feed filename should be feed-itemsforsale.xml.  Save Changes.
  12. Do a manual upload of your file that was saved in step 9 above.
  13. Wait for a little while for the file to process.  After it has completed click on the data feed name to check for errors.
  14. Be familiar with the Program Policies.  They stipulate things like “All item pages must be able to accept electronic payments and process transactions securely online (SSL-protected).” You might want to consider setting up Google Checkout as a merchant.
  15. If you get it working please consider making a donation to me or at the very least a nice comment here!

Leave Your Comment

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

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>