[wp-trac] [WordPress Trac] #58379: Can't disable the default wordpress xml sitemap
WordPress Trac
noreply at wordpress.org
Tue May 23 18:45:37 UTC 2023
#58379: Can't disable the default wordpress xml sitemap
--------------------------+------------------------------
Reporter: ema15 | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Sitemaps | Version:
Severity: normal | Resolution:
Keywords: | Focuses:
--------------------------+------------------------------
Comment (by pbiron):
Replying to [comment:6 ema15]:
> I'm not using a plugin, I create my own by adding the code below to
functions.php
Earlier you said:
Replying to [comment:4 ema15]:
> My website is live and contain mayn plugins and functionalities.
So, I suspect that one of the **other plugins** you have on your site is
overriding your use of `add_filter( 'wp_sitemaps_enabled',
'__return_false' )`. The most likely candidate for such a plugin is an
SEO plugin...which is why I asked whether you have an SEO plugin
installed.
I'll also note that I cannot replicate the behavior you describe on a
fresh WP site with the TwentyTwentyThree theme and no other plugins than
one that hooks `wp_sitemaps_enabled` on (or before) the `init` action.
Can you verify that you're not hooking `wp_sitemaps_enabled` **after** the
`init` action?
In order to determine whether there really is a bug in WP core, we need
more information from you, including (but perhaps not limited to):
1. what plugins you have active on your site
2. **when** you are hooking `wp_sitemaps_enabled`
--
Ticket URL: <https://core.trac.wordpress.org/ticket/58379#comment:7>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list