Hello,
We apologize for the issue you are facing with the Rank Math sitemap including the page-sitemap.xml
URL that is being rejected by Google Search Console. This can happen due to incorrect entries for translated homepages or other configuration issues.
To resolve this, you can try adding the following code to your theme’s rank-math.php
file:
// Remove incorrect entries for translated homepages in the sitemap
add_filter( 'rank_math/sitemap/entry', function( $url, $post ) {
if ( $post->post_type === 'page' && !is_front_page() ) {
return false; // Exclude the page from the sitemap
}
return $url;
}, 10, 2 );
This code snippet will help exclude the unwanted page entries from your sitemap. If you continue to experience issues, please ensure that there are no conflicting plugins or settings that might be causing this problem. You can also check for plugin conflicts using the Health Check plugin.
If you would like more comprehensive assistance, we recommend our professional setup service, which ensures your plugin setup is fully correct and adheres to the latest SEO standards. You can find more information about this service at Rank Math Services.
Thank you for raising this concern! If you have any further questions or need additional help, please reply to this ticket, and a human agent will assist you further.
Sources:
Multilingual SEO with Rank Math SEO & WPML » Rank Math
Hello,
If the issue persists after adding the filter we shared above, then this can be caused by a conflicting plugin/theme on your site.
To determine that, please follow this troubleshooting guide:
https://rankmath.com/kb/check-plugin-conflicts/
Here is a video you can follow as well: https://www.youtube.com/watch?v=FcIWRhcUP2c
Only the site admin would know and your users won’t be affected by this troubleshooting.
Looking forward to helping you.
Hello,
Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.
If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.
Thank you.