-
I see that a page that does not exist on the website has been included in the sitemap by Rankmath. How can I remove this page from the sitemap? How can I update the sitemap?
-
Hello,
We apologize for the issue you are facing with your sitemap including a non-existent page. To remove a page from the sitemap generated by Rank Math, you can follow these steps:
-
Check for the Page: First, ensure that the page is indeed deleted from your website. If it still exists in the trash, it may still appear in the sitemap.
-
Exclude the Page from the Sitemap: If the page is deleted but still appears in the sitemap, you can manually exclude it by going to Rank Math > Sitemap Settings and adding the URL of the page you want to exclude in the Exclude Posts section.
-
Update the Sitemap: After making changes, you can update your sitemap by simply visiting your sitemap URL (usually `https://rankmath.com/kb/fix-sitemap-issues/#nginx-server-error). Rank Math automatically regenerates the sitemap when changes are made.
-
Flush Cache: If you are using a caching plugin, make sure to clear your cache to see the updated sitemap. You can also flush the sitemaps cache in Rank Math settings.
-
Check for Plugin Conflicts: If the issue persists, there might be a plugin conflict. You can use the Health Check plugin to identify any conflicts.
For more detailed guidance on fixing sitemap issues, you can refer to our article on Rank Math Sitemap Issues and Their Fixes.
If you need further assistance or if this does not resolve your issue, please reply to this ticket, and a human agent from our support team will assist you further.
Thank you for raising this concern!
Sources:
Rank Math Sitemap Issues and Their Fixes » Rank MathHello,
Please note that the sitemap will not remove redirected URLs that are still available in the WordPress backend.
You can either delete/unpublish/draft those pages, or set them to noindex and they will be removed from the sitemap completely.
Alternatively, you can use this filter to remove it manually from your sitemap:
add_filter( 'rank_math/sitemap/entry', function ( $url, $type, $object ) { $urls_to_skip = array( 'https://www.cbhukuk.com/en/home/' ); if ( isset( $url['loc'] ) && in_array( $url['loc'], $urls_to_skip ) ) { return false; } return $url; }, 10, 3 );
You may refer to this guide on how to add filters to your website:
https://rankmath.com/kb/wordpress-hooks-actions-filters/Looking forward to helping you.
When I create a sitemap with other tools, this URL does not appear. However, Rank Math insists on including this URL in the sitemap. I made a 410 redirect, but it still appears in the sitemap. I really do not understand what the problem is.
Hello,
Please follow the steps below for initial troubleshooting:
1. Flush the Sitemap cache by following this video screencast:
https://i.rankmath.com/pipRDp2. Exclude the Sitemap files of the Rank Math plugin in your caching plugin. The cache could be via a plugin or from the server. For plugins or Cloudflare, please follow this article: https://rankmath.com/kb/exclude-sitemaps-from-caching/
If the issue persists then try disabling the transient cache for the sitemap. This will make sure that your XML sitemap always reflects the latest changes on your site. Kindly add this code snippet to your site:
/** * Filter if XML sitemap transient cache is enabled. * * @param boolean $unsigned Enable cache or not, defaults to true */ add_filter( 'rank_math/sitemap/enable_caching', '__return_false');
If you’re not sure how to add this code, you can follow this guide: https://rankmath.com/kb/wordpress-hooks-actions-filters/.
After you add the code, please clear any cache on your site or server and check your XML sitemap again. If you’re still facing issues with the sitemap, please let us know – we are happy to investigate further.
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.
-
The ticket ‘about sitemap’ is closed to new replies.