error 404 sitemap with litespeed

#327813
Viewing 9 replies - 1 through 9 (of 9 total)
  • Hello,

    Thanks for contacting us and sorry for any inconvenience that might have been caused due to that.

    If the sitemap is returning a 404 error then it must be being cached by your caching plugin or by a server-side caching. Please follow this guide to exclude the sitemap from cache: https://rankmath.com/kb/exclude-sitemaps-from-caching/

    Please don’t hesitate to get in touch in case you need any other assistance.

    Stefano
    Rank Math business

    Hi Jaideep
    Yes, I also followed that guide but I keep having problems 🙁

    Hello,

    The issue occurs due to caching. Please add the filter given below in your theme’s functions.php file to avoid any server-side cache:

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

    Let us know how that goes. Looking forward to helping you.

    Thanks.

    Stefano
    Rank Math business

    Excuse my ignorance but I copied your code and pasted it into the functions.php file of the tempalte.
    Can you see if I did it right?
    The problem is that if I update the tempalte I lose that modification, right?

    Hello,

    I can check that your sitemap is working fine. If you don’t have a child theme then you can follow this guide to create a new file and avoid losing the changes after updating the theme: https://rankmath.com/kb/wordpress-hooks-actions-filters/

    Hope this helps. Let us know if you need any other assistance.

    Thanks.

    Stefano
    Rank Math business

    Perfect, you’re number one.
    so I just use that plugin and put the code you gave me and set it to run: Run the snippet everywhere or Active only in the public area?

    Hello,

    Use the Run the Snippet Everywhere for the snippet settings.

    Let us know if you need any other assistance.

    Thanks.

    Stefano
    Rank Math business

    ok thanks a lot

    Hello,

    Glad that helped.

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

    We are here to help.

    Thank you.

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

The ticket ‘error 404 sitemap with litespeed’ is closed to new replies.