Demac Media Demac Media Brand Demac Media Brand



Mini Tutorial: Adding WordPress Posts & Categories to Magento’s Google Sitemap

Timer Icon 3 Mins

Development, Magento Tutorials

Google’s crawlers may miss some content pages during the regular crawling process, therefore simply submitting a Sitemap will let Google know about the pages available on your site. However, if you’ve got the full Fishpig WordPress Integration on your site, it is important to note that by default, Magento will only export the Product, Catalog and CMS pages. Excluding Blog posts and any other WordPress content. So in order to get your site properly indexed on search engines, the next step will be to submit your Sitemap manually to a search engine like Google, Bing, or Yahoo. Creating and submitting a Sitemap ensures that search engines are aware of all the pages available on your site.

Why Should You Submit a SiteMap

This can pose a problem for a lot of merchants. When a site is not indexed properly, it means the search engine is unaware of the content on your site therefore impacting your page rank. So what do you need to do? Export the all the pages of your site yourself! Here’s how to do it:

  1. Go to Catalog (back end link) Google site in the backend to generated a Google sitemap.
  2. The next logical step would be install a plugin in WordPress to export a Google sitemap.

By default the WordPress Google Sitemap plugin is not compatible with Magento because Fishpig alters to the URL. That sitemap will not link to what you want it to link. Fishpig’s full integration requires you to have a different subdirectory URL than your WordPress URL, where you installed WordPress. Here’s an example:

If you export the Sitemap with the WordPress plugin, the link will go to the WordPress URL instead of Magento URL. It is being directed to the wrong URL.

How should I properly export the sitemap?

The answer is to rewrite Magento’s Google Sitemap extension to generate the WordPress with Fishpig functions. The following Gists shows you how to do it:

You can also extended the code to include any customized link you have added to your Magento site. For example, I have many custom post type listing pages for my site. I have extended the code to include archive listing pages, video listing pages and article listing pages. Each listing page has a sub-listing page which is filtered by date and category. What you want to include in the sitemap is in your hand as you can control it by exporting the site in this method.

Subscribe to the Blog

Stay updated with 20,000+ eCommerce leaders in our community

Sign Up

Let’s talk about your 10X return

Icon/Social/Phone Contact us for pricing information