Producing a sitemap using the Simple XML Sitemap module in Drupal is simple and robust. Not only does it make your content easier for search engines to index, but it also keeps your site SEO-friendly as it expands. Simple Sitemap is an indispensable tool for any Drupal project with its automation and flexibility.
When developing a Drupal website, one fundamental task in search engine optimization (SEO) and usability is the creation of a sitemap. A sitemap gives Google and other search engines a clear map of your site's structure, so your content is found and indexed quickly. For Drupal 8, 9, and 10, perhaps the most user-friendly method to create an XML sitemap is by utilizing the Simple XML Sitemap module (commonly referred to as Simple Sitemap).
In this article, we’ll walk through what Simple Sitemap does, why it’s useful, and how to create and configure a sitemap for your Drupal website.
What is Simple Sitemap?
The Simple XML Sitemap module will create an automatically generated sitemap for your Drupal site according to the sitemaps.org protocol. Contrary to standard sitemap modules, Simple Sitemap emphasizes simplicity and flexibility along with compatibility with new-generation search engines.
Key features:
• Automatic sitemap generation for custom entities, taxonomies, and content types.
• Multiple languages support.
• Compatibility with Views, custom routes, and menu links.
• Simple configuration through the Drupal admin UI.
Support for automatic updates via cron.
Why Use Simple Sitemap?
- Improved SEO – Makes sure your key pages are crawled by search engines.
- Automation – Updates automatically when new content is added.
- Flexibility – Allows you to include or exclude certain content types, entities, or paths.
- Multilingual Support – Compatible with multilingual websites, producing hreflang tags.
- Search Engine Notifications – Automatically pings search engines when your sitemap is updated.
Installing Simple Sitemap
You can install the module using Composer (recommended):
composer require drupal/simple_sitemap
Then, enable the module:
drush en simple_sitemap -y
Or through the Drupal admin UI under Extend.
Creating Your Sitemap
After installation and activation, you can set up the sitemap:
- Navigate to the Configuration page:
- Visit Configuration > Search and Metadata > Simple XML Sitemap.
- Set Global Settings:
- Determine how often the sitemap will be updated (cron or manual rebuild).
- Determine if search engines should be notified automatically.
- Add Content to the Sitemap:
- Under the Content Types tab, choose which types (e.g., Article, Page) will be included.
- To taxonomy terms or menu links, navigate to their respective tabs.
- You may also manually add custom paths or routes.
- Save and Generate the Sitemap:
- Click Generate Sitemap.
- The sitemap will be generated at /sitemap.xml.
Advanced Configuration
- Views Integration: Reveal a View's URL in the sitemap to incorporate dynamic content.
- Priority and Change Frequency: Modify how frequently content needs to be crawled and its relative priority.
- Multilingual Support: Support language options with hreflang attributes for translated content.
Best Practices
- Include only canonical and indexable pages.
- Omit admin pages, search results, and duplicate content.
- Limit your sitemap to under 50,000 URLs (broken up into several sitemaps if it is needed).
- Check logs for errors regularly and re-generate after significant content updates.
Conclusion
Producing a sitemap using the Simple XML Sitemap module in Drupal is simple and robust. Not only does it make your content easier for search engines to index, but it also keeps your site SEO-friendly as it expands. Simple Sitemap is an indispensable tool for any Drupal project with its automation and flexibility.