The Simple XML Sitemap module was originally created by gbyte as a temporary replacement for the non-functioning Drupal 8 XML Sitemamp Module. After putting some more work into it however, we decided to keep using it in our D8 & D9 projects, as it is very lightweight, simple to use and most importandly, adheres to a newer XML sitemap standard.
The 2.x branch features most of the functionality of the heavier XML Sitemap module while also featuring hreflang and image XML sitemaps, which is a new Google standard for creating multilingual XML sitemaps that should improve SEO even more.
The 3.x branch adds a robust generation process that works with huge sites in limited environments. It also introduces the concept of sitemap variants which are instances of different sitemap types which in turn are made of sitemap and URL generators. This makes it possible to run several different sitemap types on one Drupal instance.
The 4.x branch is a rewrite with developers/integrators in mind and makes much greater use of Drupal's entity API dropping some of its very specific chaining API. On top of that, it features many code and UI improvements.
Here is the description from the module page:
Every webpage needs an automatic XML sitemap generator for SEO reasons. Sitemaps generated by this module adhere to the new Google standard regarding multilingual content by creating hreflang sitemaps and image sitemaps - Googlebots will thank you later.
In addition to the default hreflang sitemaps, the module's API allows creating and publishing of custom sitemaps with arbitrary content.
The module generates a multilingual sitemap for entities, views and custom links. Out of the box it supports most of Drupal's content entity types including:
- taxonomy terms
- menu links
Contributed entity types like commerce products can be indexed as well. Various inclusion settings can be set for bundles and overridden on a per-entity basis. Sitemap generation can be altered through custom URL generator plugins and hooks. The sitemaps can be automatically submitted to search engines.
Here is a sample of the markup it generates (press ctrl+u to view the source).
Ability to create any type of sitemap via plugins
The 8.x-3.x release allows not only for customizing the URL generation through UrlGenerator plugins as 2.x does, but also creating multiple custom sitemap types through sitemapGenerator plugins and running all the sitemaps on the same Drupal instance. Now e.g a Google news sitemap can be added to a Drupal instance. This is possible through the new concept of sitemap variants.
Ability to create sitemap variants of various sitemap types via UI
Now e.g links form a specific entity bundle can be indexed in a specific sitemap variant with its own URL.
No more out of memory/time errors
The generation process has been streamlined to using a single queue regardless of whether batch generation is being used, or backend (cron/drush) processes. This should allow hundreds of thousands of entities/elements being indexed without memory errors.
If there is a problem, the generation process picks up from the last indexed element. The sitemap variants are only published after the generation has been completed.
- Automatic submission to search engines
- Views and views arguments support
- XSL stylesheets for human visitors
- Performance test script included
Module rewrite with developers/integrators in mind
4.x makes much greater use of Drupal's entity API dropping some of its very specific chaining API. See.
See this post for more details on the 4.x branch.
Should you use this over 3.x?
Yes. New features are only coming to 4.x.
Please do not forget to run
drush updbor update.php after every update. If you get an error, run core/rebuild.php before the above.
Keep in mind, the module APIs change between major releases.
- Branch 8.x-1.x is no longer supported and there is no upgrade path.
- You can upgrade from any 8.x-2.x version to 8.x-3.x or (preferably) to 4.x.
Similar modules: XML Sitemap was the de facto XML sitemap generator prior to Drupal 8 and a stable version for D8 has just been released.
Feel free to grab the module from the module page.
If you are unsure whether to get simple_sitemap or xmlsitemap, check out this comparison on the two modules.
This article describes all the new features of the 4.x version.