News sitemap not up to date

#1056862
  • Resolved antho
    Rank Math free

    I have to manually refresh my sitemap by changing the “links per sitemap” value and saving the settings each time.
    Is there a way to keep my sitemap automatically up to date?

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

    We apologize for the issue you are facing with your news sitemap not being up to date. The Rank Math plugin is designed to automatically update the sitemap whenever you publish or update a post. However, if you are experiencing issues where it requires manual refreshing, there are a few things you can check:

    1. Ensure the News Sitemap Module is Enabled: Make sure that the News Sitemap module is enabled in your Rank Math settings. You can do this by navigating to Rank Math SEO → Dashboard → News Sitemap.
      Enable The News Sitemap Module

    2. Check for Caching Issues: Sometimes, caching plugins or server-side caching can prevent the sitemap from updating automatically. Try clearing your cache and see if that resolves the issue.

    3. Permalink Settings: Ensure that your permalink settings are correctly configured in Settings → Permalinks in your WordPress dashboard.

    4. Server Configuration: If you are using an Apache or Nginx server, ensure that the necessary rewrite rules are correctly set up as mentioned in our documentation. This helps in dynamically generating the sitemap.

      • For Apache, you can add the following to your .htaccess file:
        # 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
      • For Nginx, add the following to your config file:
        # START Nginx Rewrites for Rank Math Sitemaps
        rewrite ^/sitemap_index.xml$ /index.php?sitemap=1 last;
        rewrite ^/([^/]+?)-sitemap([0-9]+)?.xml$ /index.php?sitemap=$1&sitemap_n=$2 last;
        rewrite ^/([a-z]+)?-sitemap.xsl$ /index.php?xsl=$1 last;
        # END Nginx Rewrites for Rank Math Sitemaps

    If after checking these settings the issue persists, we recommend replying to this ticket with your site URL so that a human agent from our support team can assist you further. Thank you for raising this concern!

    Sources:
    Rank Math Sitemap Issues and Their Fixes » Rank Math

    Hello,

    Rank Math instantly updates your sitemap when you publish or update any posts/pages. If the sitemap is not updating automatically, it means your sitemap is heavily cached. In this case, you can apply the following filter to your site to disable the transients cache for the sitemap:

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

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

    Also, you can 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/

    Hope that helps, and please don’t hesitate to let us know if you have any other questions.

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

The ticket ‘News sitemap not up to date’ is closed to new replies.