Strapi 5 Sitemap Plugin
The Sitemap Plugin for Strapi v5 is a powerful tool to dynamically generate a sitemap in XML format for your Strapi application.
Sitemap Plugin for Strapi v5
Overview
The Sitemap Plugin for Strapi v5 is a powerful tool to dynamically generate a sitemap in XML format for your Strapi application. It automates the creation of sitemaps for your collection types and allows you to include custom links with detailed configurations, ensuring that your site is easily navigable by search engines.
Features
1. Automatic Sitemap Generation
- Creates a sitemap in XML format accessible at:
1/api/strapi-5-sitemap-plugin/sitemap.xml
2. Collection Type Integration
- Automatically includes Collection Types with support for:
- Language codes
- Dynamic patterns (e.g.,
/[slug]
) -lastmod
(last modification date) -changefreq
(change frequency for search engines) -priority
(page priority)
3. Custom Links
- Add custom URLs to your sitemap with:
- Slug-based patterns
- Individual configurations for priority, change frequency, and
lastmod
.
Installation
Install via NPM
npm install strapi-5-sitemap-plugin
Make the sitemap.xml file available
- Go to Settings:
- Select Roles unter Users & Permissions.
- Select Public
- Search for Strapi-5-sitemap-plugin
- Select getSitemap
- Save your changes.
Configuration
The plugin offers a configuration UI accessible from the Strapi Admin panel, where you can:
- Select which Collection Types should be included in the sitemap.
- Define patterns and attributes for language-specific or global sitemaps.
- Add custom URLs with specific metadata.
Usage
View the Sitemap
Once installed and configured, your sitemap will be available at:
1/api/strapi-5-sitemap-plugin/sitemap.xml
Set your base URL
- Go to Settings
- Select Configuration under Sitemap
- Set your Base URL and hit Save.
Adding Collection Types
- In the same Settings area, navigate to the Collection Types section.
- Select the Collection Types you want to include.
- Configure the pattern, language code, and other metadata as required.
- Changes will be saved automatically
Adding Custom URLs
- In the same Settings area, navigate to the Custom Links section.
- Add your URLs with slugs and configure the priority, frequency, and last modification date.
- Changes will be saved automatically
Example Sitemap Output
1<?xml version="1.0" encoding="UTF-8"?>
2<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
3 <url>
4 <loc>https://example.com/your-collection-type-slug</loc>
5 <priority>0.8</priority>
6 <changefreq>daily</changefreq>
7 <lastmod>2025-01-15T10:00:00Z</lastmod>
8 </url>
9 <url>
10 <loc>https://example.com/your-custom-page</loc>
11 <priority>0.5</priority>
12 <changefreq>monthly</changefreq>
13 </url>
14</urlset>
Need a Custom Plugin or Feature?
Do you need a custom Strapi plugin or a specific feature for your project?
DigitalMoonrise is specialized in Strapi plugin development and tailored solutions to fit your needs.
📧 Feel free to contact me via my website: DigitalMoonrise, your digital agency for Websites, Online Shops and Configurator with Next.js and Strapi
Contributions
Contributions are welcome! Please fork the repository and submit a pull request for any improvements or bug fixes.
License
This plugin is licensed under the MIT License.
Install now
npm install strapi-5-sitemap-plugin
Create your own plugin
Check out the available plugin resources that will help you to develop your plugin or provider and get it listed on the marketplace.