[wp-trac] [WordPress Trac] #51860: wp-sitemap includes empty post entries returned by filters
WordPress Trac
noreply at wordpress.org
Tue Nov 24 05:31:58 UTC 2020
#51860: wp-sitemap includes empty post entries returned by filters
--------------------------+-----------------------------
Reporter: jsmoriss | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Sitemaps | Version: 5.5
Severity: normal | Keywords:
Focuses: |
--------------------------+-----------------------------
The ./wp-includes/sitemaps/providers/class-wp-sitemaps-posts.php class
applies the 'wp_sitemaps_posts_show_on_front_entry' and
'wp_sitemaps_posts_entry' filter, which may enrich the $sitemap_entry, or
return false, or return an empty array (as another way to exclude a post
from the sitemap, for example). This is preferable if the post needs to be
excluded based on some post meta, etc. Currently, the empty $sitemap_entry
is added to the wp-sitemap.xml, which is incorrect. The empty
$sitemap_entry should be skipped.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/51860>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list