PrestaShop XML sitemap: how to generate it and submit it to Google

A PrestaShop XML sitemap is a file that lists the URLs of your products, categories and CMS pages and tells Google what is in your store and when it last changed. In short: generate it with the free gsitemap module or a dedicated module, reference it in robots.txt, submit it once in Google Search Console and refresh it daily with a CRON job. Below: what to include, languages and multistore, and common mistakes.

What is a sitemap and does a PrestaShop store need one?

A sitemap is a plain XML file in the format described on sitemaps.org. Each entry holds a page address (loc) and, optionally, the date it was last modified (lastmod). Google reads it as a hint: which URLs you consider important and which ones are worth crawling again.

A small website with good internal linking can manage without one. A store is different:

  • it has thousands of products, many buried deep in category pages,
  • prices, stock and descriptions change every day,
  • new products have no external links pointing to them yet,
  • it often runs in several languages.

In that situation a sitemap helps Google discover new products faster and notice changes. But a sitemap does not guarantee indexing: thin or duplicate pages can still be left out.

What should a PrestaShop XML sitemap contain?

The rule is simple: include only the URLs you want to see in Google results. Each of them should return a 200 status, not redirect, not carry a noindex tag and be the canonical address.

Page type Include? Notes
Active products yes the core of the sitemap, with lastmod and images
Categories yes without filter and sorting URLs
CMS pages yes terms and privacy pages do no harm, but they are not a priority
Brands and suppliers depends on the store only if those pages have real content, not just a product list
Cart, login, account, checkout no they are blocked in robots.txt anyway
Search results, filters, parameter pagination no they create thousands of near-identical URLs
Disabled or deleted products no they return a 404 or a redirect

A few technical details worth knowing:

  • One file can hold at most 50,000 URLs and 50 MB uncompressed. Larger stores split the sitemap into several files and tie them together with a sitemap index file, which is the one you submit to Google.
  • Google ignores the priority and changefreq fields. Do not spend time fine-tuning them.
  • lastmod does matter, but only if it is accurate. If every URL always shows today's date, Google stops trusting it.
  • Product photos can be added as an image sitemap (image:image), which helps with Google Images. Since 2022 Google only uses the image URL itself; captions and titles in the sitemap are ignored, so set your alt texts on the product page.

The sitemap should list exactly the URLs your customers see. If you change your URL format, for example by removing IDs from it, regenerate the sitemap right after the change. Our guide to removing IDs from PrestaShop URLs explains how to do that without losing rankings.

How do you generate a sitemap with the gsitemap module?

PrestaShop has a free module called Google sitemap (technical name gsitemap). Depending on your version it is already in the modules folder, or you can download it from PrestaShop's official GitHub repository.

  1. Go to Modules > Module Manager, search for gsitemap, click Install and then Configure.
  2. Choose how often you update your store. This sets changefreq, which Google ignores anyway, so there is no wrong answer.
  3. Untick the pages you do not want in the sitemap (for example contact, new products or prices drop, if they do not matter to you in search).
  4. Click Generate sitemap. With a large catalogue this takes a few minutes; the module writes the files in batches.
  5. The top of the configuration page then shows the address of the main file, for example https://yourstore.com/1_index_sitemap.xml. That is the URL you submit to Google.

The module writes its files to the store's root folder (PHP needs write access there), named by shop and language, for example 1_en_0_sitemap.xml. It includes active, visible products, active categories, indexable CMS pages and product images.

gsitemap or a dedicated sitemap module?

For a small single-language store, gsitemap is usually enough. Its limits start to show as the catalogue grows or when the store serves several markets:

Need gsitemap Dedicated module
Products, categories, CMS, images yes yes
Separate sitemaps per language yes, in the file names yes, split by content type too
Separate sitemaps per multistore shop yes, one run per shop yes
Split by content type (products, categories, CMS) no, everything in one series of files depends on the module
Large catalogues (tens of thousands of products) generates in batches through redirects, can be slow depends on the module

Separate sitemaps per content type let you see in Search Console what share of your products alone is indexed.

If gsitemap is not enough for your catalogue, choose a dedicated module carefully: check that it splits the sitemaps by content type, runs from CRON and copes with the number of products you have.

How do you handle several languages and multistore?

Several languages in one shop. Each language version has its own URLs (for example /en/, /fr/), so each needs its own entries in the sitemap. Both gsitemap and dedicated modules create separate files per language and list them in one index file. The links between language versions (hreflang) are output in the page head by the Classic and Hummingbird themes, so you do not have to repeat them in the sitemap. Do check that your theme has not removed that block, though.

Multistore. Each shop gets its own index file (1_index_sitemap.xml, 2_index_sitemap.xml and so on). If the shops run on different domains, each domain is a separate property in Google Search Console, and in each one you submit only that shop's sitemap, on its own domain. In gsitemap, switch the context to the right shop (the shop selector at the top of the back office) before generating, because the module works on the current shop.

Watch out: one shop's sitemap should not contain URLs from another shop's domain. Google only accepts a sitemap whose URLs belong to the property you submit it in (the exception is a sitemap referenced in that domain's own robots.txt).

How do you submit your sitemap in Google Search Console?

  1. Add your store to Google Search Console as a domain property (covers all protocols and subdomains) or a URL-prefix property and verify ownership.
  2. Go to Indexing > Sitemaps.
  3. Under Add a new sitemap, enter the index file address, for example 1_index_sitemap.xml, and click Submit.
  4. After a while you will see a status and the number of discovered pages. If Google couldn't fetch it, open the URL in a private window and check that it returns XML, not an error or a redirect.
  5. In the Pages report, filter by your sitemap to see which submitted URLs are not indexed and why.

You submit a sitemap once. Google comes back to it on its own and reads the updated files on later visits. Also reference it in robots.txt: in Shop Parameters > Traffic & SEO, under Robots file generation, click Generate robots.txt file. In PrestaShop 8 and 9 the store then adds a Sitemap: line with the index file address, provided the sitemap already exists. That way other search engines, Bing included, find it too; you can also submit it manually in Bing Webmaster Tools.

What about "pinging" Google? In 2023 Google retired its sitemap ping endpoint. If a module or a tutorial tells you to "ping Google", skip that step, because it does nothing. What counts today is a current file, accurate lastmod dates and a sitemap submitted in Search Console or listed in robots.txt.

How do you refresh the sitemap automatically with CRON?

A sitemap generated once will, within weeks, list deleted products and miss new ones, so automate the refresh.

The gsitemap configuration page shows a ready-made CRON URL with a token, roughly like https://yourstore.com/module/gsitemap/cron?token=…. In your hosting panel, add a job that calls this URL once a day, ideally at night:

0 3 * * * curl -sL "https://yourstore.com/module/gsitemap/cron?token=YOUR_TOKEN&id_shop=1" > /dev/null

  • The -L flag matters: the module builds large sitemaps in batches and moves between them with redirects.
  • In multistore, add a separate job for each shop with its own id_shop.

Common PrestaShop sitemap mistakes

  • Old URLs in the sitemap. After changing the link format (for example after removing IDs from URLs), the sitemap still points to old, redirected URLs. Regenerate it right after the change.
  • Filter and parameter URLs. Thousands of category variants dilute the sitemap and waste Googlebot's time.
  • Sitemap blocked in robots.txt, or a file that is unreachable because of password protection or maintenance mode.
  • A sitemap on the staging copy. A test copy of the store that is public or submitted in Search Console can duplicate your live content.
  • No refresh. An old sitemap is full of 404s.
  • Expecting the sitemap to rank the store. It helps Google find pages, but how they look in results depends on content and structured data. Prices and stars in Google are covered in our guide to PrestaShop rich snippets.

If you would rather have someone set up the sitemaps, CRON and Search Console for you, we can do it as development work.

Frequently asked questions

Where is my PrestaShop sitemap?

With the gsitemap module, the index file sits in the store's root folder and is called 1_index_sitemap.xml (the digit is the shop number). The module configuration shows the exact URL. Other modules may use different file names, so check their settings.

How often should I regenerate the sitemap?

Once a day via CRON is enough for most stores. More important than frequency is that lastmod dates only change when a product really changed.

Do I have to resubmit the sitemap in Search Console after every change?

No. You submit it once and Google returns to it by itself. Resubmitting only makes sense when the file address changes, for example after switching modules.

Why does Google index fewer pages than my sitemap lists?

A sitemap is only a hint. Google skips duplicate, very similar or low-value pages, as well as URLs that redirect or carry noindex. You will find the reasons for specific URLs in the Pages report filtered by your sitemap.

Running a multilingual store or a multistore? Contact us and we will help you set up your sitemaps.

Products in this article

Back to Blog

Loading...
Back to top