[wp-trac] [WordPress Trac] #61293: Display an empty sitemap instead of 404
WordPress Trac
noreply at wordpress.org
Fri May 24 20:10:50 UTC 2024
#61293: Display an empty sitemap instead of 404
-------------------------+-----------------------------
Reporter: Cybr | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Sitemaps | Version:
Severity: normal | Keywords:
Focuses: |
-------------------------+-----------------------------
The sitemap can be empty when something filters its contents (I do that
with The SEO Framework via indexability checks, such as "noindex").
When the sitemap is empty, `WP_Sitemaps::render_sitemaps()` currently
bails to a 404.
I recommend sending an empty sitemap instead.
This change aligns with the user's expectations: They can actually see the
sitemap and understand it is empty instead of "not working, eh, where do I
start?".
Also, with the change, Google Search Console will say, "Sitemap can be
read, but has errors" instead of "Sitemap could not be read". The former
is a bit more descriptive of the situation.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/61293>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list