XML Site Map

Building a sitemap for search engines

Building your Site Map

Search engines like Google prefer to consume site maps in XML, which is more efficient than a site map created in HTML, with markup to make it attractive to humans. Sitemaps produced for search engines are designed using the format defined by sitemaps.org.

A plugin is available to produce an XML sitemap for your store. After installing and running this plugin, you can submit the resultant files to Google for indexing.

The XML sitemap is a series of text files that follow a specific format. Here’s what one entry from the product sitemap might look like:

 <url>
  <loc>http://YOURSTORE.com/shop/index.php?main_page=product_info&amp;products_id=181</loc>
  <lastmod>2020-08-21</lastmod>
  <changefreq>weekly</changefreq>
  <priority>1.00</priority>
 </url>

This site map is produced for the benefit of search engines, and should not be confused with the storefront sitemap, which is produced for the benefit of human visitors.

NOTE: You should not use random utilities found from a web search to create an XML site map; use a Zen Cart aware program like the plugin noted above instead. The reason is that a naive sitemap builder will include the cPath parameter in the product_info page URL, whereas the canonical URL will not, which will cause search engines not to not index these pages.

Example:

<url>
  <loc>https://YOURSITE.net/index.php?main_page=product_info&cPath=19&products_id=66</loc>
  <lastmod>2022-07-18T22:38:55+00:00</lastmod>
  <priority>0.80</priority>
</url

Submitting a non-canonical URL like this will yield the following from Google:

URL inspection error

When you switch to a sitemap that uses canonical URLs, the page will be indexed.

Submitting your Site Map

The instructions for submitting your sitemap to various crawlers change all the time. The best way to figure out how to do this is to do a web search for “submit sitemap to name-of-search-engine” and look for a page from the search engine provider (Google, Microsoft, etc.).




Still have questions? Use the Search box in the upper right, or try the full list of FAQs. If you can't find it there, head over to the Zen Cart support forum and ask there in the appropriate subforum. In your post, please include your Zen Cart and PHP versions, and a link to your site.

Is there an error or omission on this page? Please post to General Questions on the support forum. Or, if you'd like to open a pull request, just review the guidelines and get started. You can even PR right here.
Last modified May 13, 2024 by Scott Wilson (8e14df8e).