Strapi plugin logo for Strapi 5 Sitemap Plugin

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

  1. Go to Settings:
  2. Select Roles unter Users & Permissions.
  3. Select Public
  4. Search for Strapi-5-sitemap-plugin
  5. Select getSitemap
  6. 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

  1. Go to Settings
  2. Select Configuration under Sitemap
  3. Set your Base URL and hit Save.

Adding Collection Types

  1. In the same Settings area, navigate to the Collection Types section.
  2. Select the Collection Types you want to include.
  3. Configure the pattern, language code, and other metadata as required.
  4. Changes will be saved automatically

Adding Custom URLs

  1. In the same Settings area, navigate to the Custom Links section.
  2. Add your URLs with slugs and configure the priority, frequency, and last modification date.
  3. 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

STATS

1 GitHub star60 weekly downloads

Last updated

34 days ago

Strapi Version

5.7.0 and above

Author

github profile image for DigitalMoonrise
DigitalMoonrise

Useful links

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.