Sitemap keeps dissappearing after any website change

#71211
  • Resolved EasyMove Services
    Rank Math free

    Hi,

    I’ve noticed that every time I make any changes to my website (ie: activating or deactivating a plugin or emptying the pages cache) the sitemap_index.xml and its children disappear; therefore, I have to constantly flush my sitemap by saving the permalink under settings and sitemap settings within rank math.

    In addition, I got W3 total cache plugin installed and within its minify and page cache settings I included the following:

    First: Under “never minify the following pages:(shown below) I added these URL codes from a Yoast support page, guessing it might work

    sitemap(_index)?\.xml(\.gz)?
    [a-z0-9_\-]*sitemap[a-z0-9_\-]*\.(xml|xsl|html)(\.gz)?
    ([a-z0-9_\-]*)?\.xml

    Second: Under “Never cache the following pages: (Shown below) which I believe were properly added by your support some weeks ago.

    wp-.*\.php
    index\.php
    sitemap_index.xml
    page-sitemap.xml
    post_tag-sitemap.xml
    category-sitemap.xml
    post-sitemap.xml
    attachment-sitemap.xml

    Finally, I read a post from Pratik somewhat related to my issue which consists in adding the code shown below in the website’s theme function; however, I’m unsure how to do this. Could I use the insert headers and footers plugin to achieve this?

    Filter to enable/disable Sitemap caching.
    /**
    * 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_true’);

Viewing 1 replies (of 1 total)
  • Alberto
    Rank Math business

    Hello,

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

    To add that function you need to go to the WordPress Dashboard > Appearance > Theme Editor and there select the functions.php file.

    Inside it, just go at the end of the file and add the code. Once you save, the code should be able to run without any issue.

    Looking forward to helping you. 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 1 replies (of 1 total)

The ticket ‘Sitemap keeps dissappearing after any website change’ is closed to new replies.