sitemap generated by Rank Math includes draft pages

#572488
  • Resolved Anonymous
    Rank Math free

    I have noticed that my sitemap generated by Rank Math includes draft pages, which I believe should be excluded from the sitemap. I want to ensure that only published pages are included in the sitemap for search engine indexing.

    https://prnt.sc/0lNQO9Xdnxpb

    Furthermore, I have noticed that the URLs for my pages in the sitemap end with “?page_id=85” instead of having a more user-friendly and SEO-friendly URL structure.

    I have thoroughly checked the plugin settings and documentation but couldn’t find a specific option to address these issues. I am reaching out to you for guidance and support on resolving these matters.

    Could you please provide instructions or insights on how to exclude draft pages from the sitemap and how to rewrite the URLs in the sitemap for better SEO?

    Here are some additional details that may be helpful:

    WordPress version: version: 6.2
    Rank Math version: Version 1.0.114
    Website:https://testeracademy.com/
    Sitemao URl: https://testeracademy.com/post-sitemap.xml
    Backend Location of Page: https://prnt.sc/_wOrOGZchJlS

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hello,

    Thank you for contacting Rank Math and bringing your concern to our attention. I’m sorry for any inconvenience this issue may have caused you.

    I’ve checked your post sitemap, and the draft post is already removed.

    Draft posts should not be added to sitemaps as well. If it’s still showing on your end, please clear your website and browser’s cache for troubleshooting.

    Also, please follow the steps below to ensure that your sitemaps are not getting cached:

    1. Flush the Sitemap cache by following this video screencast:
    https://i.rankmath.com/pipRDp

    2. 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 still persists, please try adding this filter to your active theme’s functions.php file:

    add_filter( 'rank_math/sitemap/enable_caching', '__return_false');

    Hope that helps.

    Thank you.

    Anonymous
    Rank Math free

    I am having this same issue with the sitemap containing draft pages. Drafts are all set to “index” by default instead of “do not index”

    For anyone wondering, you can select all drafts, go to bulk edit and set to “no index” in the pages tab.

    Still, makes me concerned that if drafts are then switched to live, they will stay “no index” unless I remember to change them manually!

    Hello @signatureeditseditingtutorialsandpresets

    Please be assured that the draft pages included in your sitemap are related to a caching issue.

    In a typical setup, draft pages and posts are automatically removed from sitemaps generated by Rank Math.

    When you set a post or page to “draft”, the Rank Math plugin is designed to update the sitemap accordingly and exclude these drafts.

    However, the sitemap may still display the draft pages if your website’s cache needs to be cleared after these changes.

    To ensure that your sitemap is up-to-date, we recommend to try the steps as suggested here :
    https://support.rankmath.com/ticket/sitemap-generated-by-rank-math-includes-draft-pages/?view=all#post-572633 to flush the sitemap cache.

    Also, when you create draft pages and if anyone attempts to access these drafts, the website will return a 404 error, indicating the page is unavailable.

    Once a draft page is switched to “published,” it goes live, and the default meta-rules applied are “index” and “follow.” It makes the page visible to search engines and allows them to track any links on the page.

    If you decide to revert a published page to a draft, the page is once again removed from the website and will return a 404 error when accessed.

    Even though the meta-rules might remain as “index” and “follow,” it doesn’t impact the page’s visibility as it is no longer accessible to the public or search engines.

    Therefore, there is no necessity to bulk update these draft pages from “index” to “no index.” The fact they are drafts effectively makes them “non-indexable,” as they are not reachable by search engines.

    Please feel free to create a new forum topic if the issue persists or if you have another question in the future.

    We hope that helps.

    Thank 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.

Viewing 3 replies - 1 through 3 (of 3 total)

The ticket ‘sitemap generated by Rank Math includes draft pages’ is closed to new replies.