Hello, I apologize for the issue you’re facing with your sitemap generation. Based on the information you provided, it seems that there are some sections and deleted or private pages and posts appearing in your sitemap, even though you have configured it to generate only Posts and Pages.
To troubleshoot this issue, please follow these steps:
-
Exclude Sections: Make sure that you have properly excluded the sections you don’t want to appear in the sitemap. You can do this by going to Rank Math SEO → Sitemap Settings and unchecking the boxes for the sections you want to exclude.
-
Deleted or Private Pages and Posts: If deleted or private pages and posts are still appearing in the sitemap, it’s possible that they are being cached. To exclude the sitemaps from caching, you can refer to this guide: Exclude Sitemaps from Caching.
-
Unexpected URLs in Sitemap Index: It seems that there are more URLs in the sitemap index than expected. This could be due to caching issues or incorrect configuration. To troubleshoot this, you can try the following:
-
Clear Cache: Clear any caching plugins or server-level cache that might be affecting the sitemap generation.
-
Check Sitemap Settings: Double-check your sitemap settings in Rank Math to ensure that you have configured it correctly to generate only Posts and Pages.
-
Exclude Sitemap from Caching: Add the following code to your theme’s functions.php file or rank-math.php file to exclude the sitemap from caching:
add_filter( 'rank_math/sitemap/enable_caching', '__return_false');
If after following these steps, the issue still persists, I recommend replying to your existing ticket and providing them with the information you’ve shared here. A human agent from the Rank Math Support team will be able to further investigate and assist you with resolving the issue.
I apologize for any inconvenience caused, and thank you for your patience.
Sources:
Rank Math Sitemap Issues and Their Fixes » Rank Math
Using Video Sitemaps in Rank Math
Why Isn’t My URL Included in the Sitemap? » Rank Math
Why the Sitemap_Index.xml is Throwing a 404 Error » Rank Math
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.