Skip to content

feature_request(option): adding all types of articles and pages to the sitemap.xml #42

Description

@Kristinita

1. Summary

It would be nice if the plugin would have the option for adding drafts, hidden pages and all another types of articles and pages to the file sitemap.xml. It needs for third-party tools that use sitemaps.

If the problem can be resolved by another methods, please tell me about them.

2. MCVE

2.1. Data

For example, I have the article PaletteMira.md with this line on metadata:

Status: draft

2.2. Behavior

2.2.1. Current

Pelican doesn’t add PaletteMira to the sitemap.xml.

2.2.2. Desired

A user add the new option to his Pelican configuration:

SITEMAP:
  add_all_types_of_articles_and_pages: true

Since the value is true, the plugin adds to the sitemap.xml these lines:

<url>
<loc>./Sublime-Text/PaletteMira.html</loc>
<lastmod>2025-10-22T13:05:08+03:00</lastmod>
<changefreq>always</changefreq>
<priority>1.0</priority>
</url>

3. Argumentation of the need for the option

I use 2 tools obtaining a list of HTML pages from the file sitemap.xmlLinkChecker for checking links and Pa11y CI for checking accessibility. Because Pelican sitemap plugin doesn’t add drafts and hidden pages to the sitemap.xml these tools don’t check them. I had incorrect links in drafts for a long time, because LinkChecker doesn’t check these links. Only when I added to the project another link checker check-pages, obtaining a list of HTML files from templates, not from sitemap.xml, I detected these errors.

It would be nice if tools like LinkChecker and Pa11y CI will be able to check all types of articles and pages.

4. Replies to possible counterarguments

4.1. “Just use articles and pages”

Pelican documentation about drafts:

If you want to publish an article or a page as a draft (for friends to review before publishing, for example), you can add a Status: draft attribute to its metadata. That article will then be output to the drafts folder and not listed on the index page nor on any category or tag page.

Yes, when I add Status: draft to the article metadata, I want that it will “not listed on the index page nor on any category or tag page”, but I want to see it in sitemap.xml. These aren’t contradictory things.

4.2. “Crawlers will parse your drafts and hidden pages”

I use Jinja template with the meta tag to prevent it:

{% if kira_object.status in ["draft", "hidden"] or kira_object.noindex %}
	<meta name="robots" content="noindex, follow">
{% endif %}

5. Previous discussions

In 2012, when the plugin sitemap was created, the user onlyhavecans said:

Does this skip drafts and hidden pages?

I haven’t found any follow-up discussions on this issue.

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions