Sitemap gone from time to time

#232735
  • Resolved maxxxiejazz
    Rank Math free

    Hi,

    Search Console throws me a message that it couldn’t fetch the sitemap every once in a while. Noticed that two times in 3 days, which is REALLY BAD.

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

    Hello,

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

    The couldn’t fetch error, is in most cases simply due to a bug in the Search Console, check this article for more information:
    https://rankmath.com/kb/couldnt-fetch-error-google-search-console/

    We look forward to helping you.

    Read that, thank you.

    When will you have a fix for that? It’s not the server, nor my configuration. It’s just something that shows up out of thin air.

    Worth mentioning:

    I don’t use a caching plugin, I just manually edit my htaccess (Apache, Litespeed), just to fix redirect to https://www and to fix leverage browser caching (fonts, css, js etc).

    I use Autoptimize for a couple of things, but that’s about it. And Permalinks Manager Pro with some tweaks. But I don’t think it has something to do with the sitemaps – URLs, if changed, should update automatically in DB.

    There’s no reason to make my sitemap gone. It’s just gone.

    Maybe I should just get rid of the Rankmath sitemap and use XML Google Sitemaps instead?

    Anas
    Rank Math business

    Hello,

    As I mentioned in my previous reply, the couldn’t fetch error is in most cases simply due to a bug in the Search Console.

    Please ensure that the sitemaps are excluded from caching so that Google does not see the cached versions of your sitemaps:
    https://rankmath.com/kb/exclude-sitemaps-from-caching/

    As Rank Math generates virtual sitemaps, you need to exclude them from getting cached by the caching plugin.

    As you are using the Autoptimze plugin, it does not have an easy way to exclude files from the cache so you should add the following code in your themes functions.php file:

    // Disable autoptimize on pages with the word "test" in the URL
    add_filter('autoptimize_filter_noptimize','my_ao_noptimize',10,0);
    function my_ao_noptimize() {
    if (strpos($_SERVER['REQUEST_URI'],'sitemap_index.xml')!==false||strpos($_SERVER['REQUEST_URI'],'main-sitemap.xsl')!==false/* Add here any other sitemap to exclude*/) {
    return true;
    } else {
    return false;
    }
    }
    

    Once done, clear your website and browser cache and re-submit the sitemap in the Search Console.

    If the issue persists, please add the sitemap URL in the sensitive data section so we can check further.

    I hope this helps. Looking forward to helping you.

    Please, that sounds childish for me. I have clicked the sitemap and it was gone!

    Autoptimize deletes cache when it reaches a certain size

    if (class_exists('autoptimizeCache')) {
        $myMaxSize = 100000;
        $statArr=autoptimizeCache::stats();
        $cacheSize=round($statArr[1]/1024);
        if ($cacheSize>$myMaxSize){
           autoptimizeCache::clearall();
           header("Refresh:0");
        }
    }

    Added in functions.php your function. I’ll get back to you if it happens again.

    Anas
    Rank Math business

    Hello,

    Sure, let us know if you face this issue again.

    If you have any other questions, please feel free to ask.

    We are here to assist 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 8 replies - 1 through 8 (of 8 total)

The ticket ‘Sitemap gone from time to time’ is closed to new replies.