GoogleChromeLabs / wp-sitemaps

Proposal to integrate basic XML Sitemaps in WordPress Core
GNU General Public License v2.0
97 stars 26 forks source link

core-sitemaps v0.2.0 renders 404-s with single.php #161

Closed szepeviktor closed 4 years ago

szepeviktor commented 4 years ago

Describe the bug When core-sitemaps plugin is disabled 404 (non-existent) URL-s return: 404.php template

When enabled single.php gets rendered with HTTP/200 for non-existent URL-s

swissspidy commented 4 years ago

@szepeviktor does this also happen with the current master version?

szepeviktor commented 4 years ago

Copying ....

szepeviktor commented 4 years ago

Done.

Oh Yes!

"GET /4444440000000000444444444/ HTTP/2.0" 200
szepeviktor commented 4 years ago

FYI this is my custom code

// Sitemaps
add_filter('core_sitemaps_register_providers', function ($providers) {
    unset($providers['users']);
    return $providers;
}, 0, 1);

add_filter('core_sitemaps_post_types', function ($postTypes) {
    // echo-knowledge-base plugin
    unset($postTypes['epkb_post_type_1']);
    return $postTypes;
}, 10, 1);

add_filter('core_sitemaps_taxonomies', function ($taxonomyTypes) {
    // echo-knowledge-base plugin
    unset($taxonomyTypes['epkb_post_type_1_category']);
    unset($taxonomyTypes['epkb_post_type_1_tag']);
    return $taxonomyTypes;
}, 10, 1);
swissspidy commented 4 years ago

Seems to be caused by #149, so not sure how you encounter this also in 0.2.

See #162 for a fix.