Sitemap is not updated

#1055621
  • Resolved Ethan
    Rank Math pro
    Content AI Starter

    Hi,

    We’ve noticed that our sitemap, particularly the post sitemap,is not updating after we publish new blog posts. We attempted to resolve this by adding a rewrite rule to the .htaccess file based on your guide, but it had no effect. We also tried excluding the sitemap from server-side caching on WP Engine, but that didn’t resolve the issue either.

    Could you please advise on how we can fix this?

    Additionally, how can we exclude a page from the sitemap if it has been redirected?

    Thanks,
    Ethan

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

    We apologize for the issue you are facing with your sitemap not updating after publishing new blog posts. It sounds like you’ve already taken some good steps to troubleshoot the problem. Here are a few additional suggestions that may help:

    1. Check Caching Settings: Ensure that your caching plugin (if any) is properly configured to exclude the sitemap from being cached. You can refer to our extensive tutorial on how to exclude sitemaps from caching here.

    2. Verify Rewrite Rules: Since you mentioned adding rewrite rules to your .htaccess file, please double-check that they are correctly implemented. Here’s a sample of what you might need:

      # START of Rank Math Sitemap Rewrite Rules
      RewriteEngine On
      RewriteBase /
      RewriteRule ^sitemap_index.xml$ /index.php?sitemap=1 [L]
      RewriteRule ^(.*?)-sitemap([0-9]+)?.xml$ /index.php?sitemap=$1&sitemap_n=$2 [L]
      RewriteRule ^([a-z]+)?-?sitemap.xsl$ /index.php?xsl=$1 [L]
      # END of Rank Math Sitemap Rewrite Rules

      Make sure these rules are present and correctly formatted in your .htaccess file.

    3. Check for Plugin Conflicts: Sometimes, other plugins can conflict with Rank Math. You can use the Health Check plugin to identify any potential conflicts.

    4. Exclude Pages from Sitemap: To exclude a specific page from the sitemap, you can set the visibility of that page to "noindex" in the Rank Math settings for that page. This will prevent it from appearing in the sitemap.

    If these steps do not resolve the issue, please reply to this ticket with your site URL so we can assist you further. A human agent from our support team will take over and provide more tailored assistance.

    Thank you for raising this concern!

    Sources:
    How To Exclude Rank Math Sitemaps from Caching » Rank Math
    Rank Math Sitemap Issues and Their Fixes » Rank Math
    How to Fix "Incorrect HTTP Header Content-Type" Error in Sitemaps » Rank Math

    Hello,

    Thank you for contacting Rank Math support, and sorry for any inconvenience that might have been caused due to that.

    Please follow the steps below:

    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/

    3. Apply the following filter code to your site.

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

    Here’s how you can add filter to your WordPress site:https://rankmath.com/kb/wordpress-hooks-actions-filters/

    If the issue persists, please share some of the latest posts that aren’t in the sitemap so we can take a closer look at them.

    Looking forward to helping you.

    Ethan
    Rank Math pro
    Content AI Starter

    Hi Jeremy,

    Many thanks for your reply.

    I’ve flushed the Sitemap cache by following the video you sent me. Now newly added pages are shown in the sitemap.

    We’ve already excluded the sitemap file from the server, as we are not using cache plugins.

    In this case, do I still need to apply the filter code on our website as well?

    Thanks,

    Ethan

    Hello,

    At this point, you don’t need to add the filter to disable the transient cache since the sitemap is now updating automatically.

    Continue monitoring your sitemap after publishing new content. If updates stop appearing again, we can revisit adding the filter then.

    Hope that helps, and please do not hesitate to let us know if you need our assistance with anything else.

    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 is not updated’ is closed to new replies.