Disable /wp-sitemap.xml when another plugin provides your sitemap, so search engines only see one.
add_filter( 'wp_sitemaps_enabled', '__return_false' );
Always add PHP to a staging site first, or have FTP or file manager access ready, so you can undo it if something goes wrong.
Since version 5.5, WordPress creates a sitemap at /wp-sitemap.xml. If a plugin creates a different sitemap and doesn’t switch the core one off, search engines find two. This line turns the core sitemap off.
WordPress checks wp_sitemaps_enabled before serving any sitemap URL. Returning false makes them all return 404 and removes the Sitemap line from the virtual robots.txt.
/wp-sitemap.xml alongside your plugin’s sitemap.Visit yoursite.com/wp-sitemap.xml. It should return your 404 page.