Skip to content

Feature Request: Configurable 'changefreq' Value in Sitemap Template #3516

@GorIvan

Description

@GorIvan

Hi!

I've noticed that in the sitemap.xml template file located at mkdocs/templates/sitemap.xml, the tag is hard-coded to "daily":

xml
Copy code
{%- for file in pages -%}
    {% if not file.page.is_link and (file.page.abs_url or file.page.canonical_url) %}
    <url>
         <loc>{% if file.page.canonical_url %}{{ file.page.canonical_url|e }}{% else %}{{ file.page.abs_url|e }}{% endif %}</loc>
         {% if file.page.update_date %}<lastmod>{{file.page.update_date}}</lastmod>{% endif %}
         <changefreq>daily</changefreq>
    </url>
    {%- endif -%}
{% endfor %}

This setting isn't ideal for sites that don't update every day. Could we have an option to customize this value?

Maybe we could set this in the mkdocs.yml, allowing different changefreq settings for various parts of the site. This would make the sitemap more accurate for sites with less frequent updates and give us more control over how search engines see our content.

Thanks for considering this idea!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions