PS PrestaShop Beginner

PrestaShop Advanced XML Sitemap module documentation (dfsitemap)

Install and configure dfsitemap: content, images and videos, hreflang, exclusion rules, batch generation, cron, IndexNow and multistore.

Updated Module version 1.1.0

The Advanced XML Sitemap module (dfsitemap) generates the XML sitemaps of PrestaShop 8 and 9: one index per shop, one file per language and per content type, with images, videos and hreflang tags. This page covers installation, settings, exclusion rules, scheduling and troubleshooting.

Installation

  1. Download the ZIP from your DataFirefly customer account.
  2. In the back office, go to Modules > Module Manager > Upload a module and send the ZIP.
  3. Open Shop Parameters > Traffic & SEO > Advanced XML Sitemap. Three tabs at the top of the page lead to sitemaps and settings, exclusion rules and product videos.
  4. If the native Google sitemap module (gsitemap) is enabled, disable it and delete its *_sitemap.xml files at the shop root. The module shows a warning for as long as gsitemap is enabled.
  5. Click Generate now, then Declare the sitemaps in robots.txt.
  6. Submit the index URL shown in Google Search Console and Bing Webmaster Tools.

The module runs from PrestaShop 8.0 to 9.x with the same ZIP, in multistore and multilingual setups. It needs write access to the shop root folder, where the dfsitemap-*.xml files are published, and to modules/dfsitemap/var/tmp/. An alert appears if either is not writable.

The generated files

For each shop, the module publishes an index dfsitemap-{shop id}-index.xml that points to files named by language and type, for example dfsitemap-1-en-product-1.xml. When a file reaches the URL count you set, or before 45 MB, the rest goes into -2, -3 and so on. Custom URLs with no language are grouped in dfsitemap-1-all-custom-1.xml.

When friendly URLs are enabled, the index is also served at /sitemap.xml on each shop domain. A physical sitemap.xml file at the root takes precedence over that address: the module reports it.

Files are built in a temporary folder, then published shop by shop. The old sitemaps stay online during generation, and files that are no longer needed are deleted on publishing.

Settings

Settings follow the multistore context: in a single-shop context, the saved values apply to that shop only.

Content

  • Content types: static pages, products, categories, CMS pages, CMS categories, brands, suppliers, custom URLs. Only active content is listed.
  • Static pages: home, best sellers, new products, price drops, brand and supplier lists, stores, contact, sitemap page. The brand and supplier lists are skipped when their page is disabled in the shop preferences.
  • Languages: leave everything checked to follow the active languages of each shop automatically.
  • Products visible in search only: by default only products with the visibility Everywhere or Catalog only are listed.
  • Custom URLs: one per line. A relative path such as /blog/ is added to the shop URL.
  • Additional sitemaps: absolute URLs of sitemaps produced elsewhere, for example by a blog module or a WordPress site on the same domain. They are added to the shop index.

A CMS page whose Indexation by search engines option is off is served by PrestaShop with a noindex tag. The module does not list it and shows how many pages are affected. Turn the option on for the pages that should be indexed.

Images and videos

  • Image sitemap and all product images (otherwise the cover only), in the chosen image size, large_default by default.
  • Category, brand and supplier images: the original image of each entity, when it exists.
  • Video sitemap and YouTube and Vimeo detection: the module finds videos embedded in product descriptions and CMS pages. Vimeo titles and durations are read once, then cached.

Hreflang

  • Hreflang alternates: each URL lists its translations. Useful as soon as the shop has several languages.
  • Hreflang code: language and region (en-GB, taken from the language code set in International > Languages) or language only (en).
  • x-default language: the shop default language, a specific language, or none.

Tags and display

  • lastmod: last update date of products, categories, CMS categories, brands and suppliers.
  • changefreq and priority: off by default, Google ignores them.
  • Readable display: an XSL stylesheet shows the index and the files as a table in the browser. Search engines ignore it.

Generation

  • Frequency: from every hour to once a week, used by the cron.
  • Regenerate when content changes: when a product, category, CMS page, brand or supplier is saved, the next cron call regenerates without waiting for the frequency, at most once an hour.
  • URLs per file: 10,000 by default, between 100 and 50,000.
  • Items per batch: 50 by default. Lower it on a slow server.
  • Time budget per request: 20 seconds by default, to keep below the server max_execution_time. From the back office, each request is capped at 15 seconds.

Exclusion rules

The Exclusion rules tab lists the active rules. Each rule applies to all shops or to one, and takes effect at the next generation.

  • Products: by ID, in a category (any association, subcategories included), of a brand, of a default supplier, out of stock, priced at zero, without an image.
  • Categories: by ID, or a category and all its subcategories. Products stay listed unless a product rule removes them.
  • CMS pages: by ID, or a CMS category with its pages.
  • Brands and suppliers: by ID.
  • URL contains text: one text per line, case-insensitive, for example ?q=.
  • URL matches a regular expression: one expression per line, without delimiters, case-insensitive, for example /en/.*-test$. An invalid expression is refused when you save.

IDs are entered separated by commas or line breaks. A URL excluded by a rule also disappears from the hreflang alternates of its translations.

Product videos

The Product videos tab is for videos hosted outside YouTube and Vimeo, or when you want a specific title and description. For each video: the product (search by name, reference or ID), the title and description per language, the thumbnail URL, the video file URL or the player URL, the duration in seconds and the shop concerned. An empty title in one language takes the title of another language, then the product name.

Running the generation

From the back office

Generate now starts the generation for the shops of the current context, with a progress bar. The page chains requests until the end. If you close the page, the job stays saved: the Resume in this window button continues it, or the cron takes over. Cancel stops the job, and the sitemaps online stay unchanged.

With the cron

The dashboard shows a URL like https://your-shop.com/module/dfsitemap/cron?token=.... Call it every 5 minutes from your hosting cron manager or the PrestaShop cron module. Each call works for the time budget, then the next call resumes the job. A shop is regenerated when its frequency is reached, or after a content change if that option is on. Optional parameters: force=1 to regenerate right away, id_shop=1,2 to limit the shops. The Generate a new token button invalidates the old URL.

From the command line

With SSH access, the script runs the whole job in one go, whatever the size of the catalogue:

php /path/to/prestashop/modules/dfsitemap/cron.php
php /path/to/prestashop/modules/dfsitemap/cron.php --force --shop=1

Without --force, only the shops that are due are regenerated. The script returns exit code 1 on error.

If the server kills a request during generation, the job resumes from the last saved position and the files in progress are repaired. The lock left by the killed request expires after the time budget plus 90 seconds: the back office shows the remaining delay.

IndexNow

IndexNow announces a created or updated page to Bing, Yandex, Seznam, Naver and the other engines of the protocol, without waiting for their next crawl. Google does not use IndexNow and keeps reading the sitemap.

  1. Enable Send changed pages with IndexNow in the Instant indexing block. The module writes a key file at the shop root.
  2. Each time a product, category, CMS page, brand or supplier is saved, the object is queued.
  3. At the next cron call, the module computes the URLs of that content in every language and sends them, domain by domain. Only content listed in the sitemap is sent: an inactive product or one excluded by a rule is not.

The IndexNow block on the dashboard shows the queue, whether the key file is present and the last sending with its HTTP code (200 or 202 on success). On a 429 or 5xx answer, the queue is kept for the next call. The Send now button triggers an immediate sending.

robots.txt and Search Console

The Declare the sitemaps in robots.txt button adds one Sitemap: line per shop between the # BEGIN dfsitemap and # END dfsitemap markers. When PrestaShop regenerates robots.txt from Traffic & SEO, the module writes the block again. Uninstalling removes it.

In Google Search Console, submit the index URL of each shop (or /sitemap.xml) in the property of the matching domain.

Multistore

Each shop has its own index on its own domain, its own languages and its own settings. Select a shop in the multistore menu to give it specific values; in the All shops context, values apply to shops that have no specific value. For each shop of the context, the dashboard shows the index URL, the date of the last generation, and the number of URLs per type, images, videos and files.

For developers: adding URLs

A module can add its pages to the sitemap by hooking into actionDfSitemapUrls, called while the custom URLs type is processed. The hook receives id_shop, languages (id_lang => ISO code) and link, and returns a list of entries:

public function hookActionDfSitemapUrls($params)
{
    $loc = [];
    foreach ($params['languages'] as $idLang => $iso) {
        $loc[$idLang] = $params['link']->getBaseLink($params['id_shop']) . $iso . '/blog/my-post';
    }

    return [
        ['loc' => $loc, 'lastmod' => '2026-09-01 10:00:00', 'images' => ['https://.../image.jpg']],
        ['loc' => 'https://your-shop.com/single-page'],
    ];
}

An entry whose loc is keyed by language gets hreflang tags like a native page. Invalid entries are skipped without stopping the generation.

Frequently asked questions

The sitemap contains no CMS page

Check the Indexation by search engines option of each CMS page. A page without it is noindex and is not listed.

Brands or suppliers do not appear

The module follows the shop preferences: if the brand or supplier page is disabled, that type is skipped.

Generation stays on “Another process is working on the job”

Another request holds the lock, often the cron. If that request was killed, the lock expires after the delay shown and generation resumes on its own.

Generation stops on an error

The message appears at the top of the dashboard and in Advanced Parameters > Logs. The most frequent cause is a shop root folder that is not writable. The previous sitemaps stay online.

IndexNow answers 403 or 422

The engine cannot find the key file or refuses the host. Open the key file URL shown in the IndexNow block: it must display the key. Also check that the shop domain matches the domain of the URLs sent.

Was this page helpful?

Still stuck? Contact support