-
Hello my custom post type sitemap link is returning a 404
I have tried all of these steps:
Flush Permalinks: Go to the Permalinks page in your WordPress dashboard and click on “Save Changes” even if you haven’t made any changes. This will refresh the permalinks and may resolve the 404 error.
Check robots.txt: Make sure that there are no unintended rules in your robots.txt file that are blocking access to your sitemap. You can check this by going to Rank Math SEO -> General Settings -> robots.txt.
Exclude Sitemaps from Caching: If you have caching enabled on your website, it may be causing issues with the sitemap. You can exclude the sitemaps from caching by adding the following filter to your theme’s functions.php or rank-math.php file:
add_filter( ‘rank_math/sitemap/enable_caching’, ‘__return_false’);
Reset Sitemap Settings: If none of the above solutions work, you can try resetting the sitemap settings in Rank Math. However, please note that this will reset all the settings in the Sitemap Settings, not just the one section that you’ve opened up. Before resetting, it is recommended to take a backup of Rank Math’s settings using the import/export feature. You can find more information on how to reset sitemap settings in the Rank Math knowledge base.
The ticket ‘Custom post type sitemap returning 404’ is closed to new replies.