Sitemap not updating

#676422
  • Resolved Anonymous
    Rank Math free

    Hi again

    I sent you the following message yesterday

    Hi,

    I have a sitemap that is not updating correctly.

    I have som pages that we’ve made into drafts or noindex pages because we cannot delete them completely.

    But despite they are draft pages or noindex pages, they still are in the sitemap for page which is causing problems in Ahref with 404 pages.

    E.g. this page: https://hotelviking.dk/submit-organizer-form-2/

    We have checked and our sitemap is not caching.

    Can you help?

    All the best
    Maria
    Leadmakers

    You have replied me back with two options..

    1. I can remove the pages manually from the sitemap.

    Do you have a guideline for this?

    And 2. A guideline: https://rankmath.com/kb/exclude-sitemaps-from-caching/

    We don’t use a plugin to cache our page. We use Curanet who also host our page.

    But I just checked .htaccess in the general settings in your plugin. And it says “.htaccess file not found”. Is this normal? As mentioned we don’t use a plugin to cache our page. And according to curanet sitemap is not being cached.

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

    We apologize for the inconvenience you are facing with your sitemap. To manually remove pages from the sitemap, you can follow these steps:

    1. Go to your WordPress dashboard and navigate to Rank Math > Sitemap Settings.
    2. Click on the “General” tab and scroll down to the “Exclude Posts” section.
    3. Enter the post/page ID or URL in the “Exclude Posts” field to remove it from the sitemap.

    Regarding the .htaccess file not being found, this is normal if you are not using an Apache server. If your website is hosted on Nginx, it will not have an .htaccess file. Since you mentioned that your sitemap is not being cached, it’s likely that the issue is not related to caching.

    If you are still experiencing issues after following these steps, please feel free to contact our support team for further assistance. We are available 24×7, 365 days a year and will help you out as soon as possible.

    We hope this information helps.

    Sources:
    How to Fix “Incorrect HTTP Header Content-Type” Error in Sitemaps » Rank Math
    Remove Blank Lines From Sitemaps » Rank Math
    Rank Math Sitemap Issues and Their Fixes » Rank Math
    Indexed, Not Submitted in Sitemap – Google Search Console » Rank Math

    Anonymous
    Rank Math free

    Also…

    I feel like if I exclude some pages from my sitemap, that this is a bad solution. I would want my sitemap to be updated automatically.

    Because other people in my team who primarily works on the website, sometimes make pages into a draft. And I will not know that.

    I will only discover it when Ahref tells me.

    So what will the best solution be?

    Anonymous
    Rank Math free

    Thank you for your response.

    Again I feel like that me excluding pages manually in the sitemap works a little bit like a bandage. It’s not really fixing the problem. Because every time I turn a page into a draft for example, then I would have to exclude it in the sitemap.

    And then when the page is activated again, I would have to go into rank math seo again to remove it from the excluded list.

    So it doesn’t really fixes the root of the problem. As the sitemap needs to be automatically updated without me doing anything.

    Isn’t there anything that I can do in the rank math seo plugin? Some settings or something that will solve the problems for me?

    Hello,

    Thank you for your patience.

    Please note 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”, it 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.

    If that behavior is not happening on your site, then your sitemap is still cached. Please exclude the Sitemap files of the Rank Math plugin in your caching plugin. The cache could be via a plugin or from the server.

    Also, disable the transient cache for the sitemap by applying this filter. This will make sure that your XML sitemap always reflects the latest changes on 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/

    Let us know how this goes.

    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 4 replies - 1 through 4 (of 4 total)

The ticket ‘Sitemap not updating’ is closed to new replies.