Sitemap not updating – from staging to live

#460309
  • Resolved Markus Schulte
    Rank Math free

    Hey guys,
    I have a live site and a staging site.
    When I transfer everything from the staging site to the live site, the sitemap will not add the new pages. At WP-Rocket, I added already those URLs for none caching:

    /(.*)sitemap(.*).xml
    /(.*)sitemap.xsl

    The Server uses Nginx… today I contacted the support because I read in your documentation, that those rewrite rule were important:

    # 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;
    # END Nginx Rewrites for Rank Math Sitemaps

    But they told me, that not I and they were able with my actual contract to add those changes.

    The only way I can help me currently is the following. When I transfer everything from staging to live site, in WP I have to change the permalinks. When I then change the permalinks to that structure I want, the sitemap is updated.

    Is this a possible solution for my issue, I need to handle it? I am not an expert, but is that not a critical way?

    Thank you

    Regards,
    Markus

Viewing 3 replies - 1 through 3 (of 3 total)
  • Anas
    Rank Math business

    Hello,

    Thank you for contacting Rank Math, and sorry for any inconvenience caused.

    Please add this filter to your website:

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

    That should fix the issue.

    Let us know how it goes.

    We are here to assist you.

    Dear Anas,

    i created a rank-math.php file and added your code snippet to my themes folder (/wp-content/themes/theme-name/).

    Cause of the reason i did the last transfer of “staging to live”-site yesterday, I will close the ticket and put an eye on my next transferring situation.

    Thank you Anas!

    Regards from germany
    Markus

    Anas
    Rank Math business

    Hello,

    Please feel free to reach out to us again in case you need any other assistance.

    We are here to help.

    Thank you.

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

You must be logged in to reply to this ticket.