If you want google's cache of your site to remain unchanged, is it a good idea to add noarchive to robots.txt? Or will this wipe out your caches?

  • As a note if you're interested, Cloudflare free plan includes a more "on demand" sorta cached site. Only comes online if your server is down, whereas G always makes cached available. I'm not affiliated with CF just figured I'd let ya know.
    – dhaupin
    Feb 25, 2015 at 0:33

2 Answers 2


Firstly, there is no such thing as noarchive in robots.txt. You need to add a meta tag to all pages on which you wish to prevent caching:

<meta name="Googlebot" content="noarchive">

When you have done that, then Google will stop caching the page entirely and won't show a cache link at all. There is no way to keep showing the old cache while preventing new caches.


The only problem is, it could take a month before Google re-crawls your entire site.

add_action( 'wp_head', 'add_meta_tag' );
function add_meta_tag() {
  1. Add this PHP to your child themes functions file
  2. Then re-build your site map
  3. And submit the sitemap URL to Webmaster Tools > Crawl > Fetch as Google
  • 2
    Whoe man, please note that the above script is for WordPress. We don't need folks dropping in undefined functions to their non-wp platforms. Also you are better off doing that in htaccess using X_ROBOTS header for a fully encompassed flag. Think media files and stuff.
    – dhaupin
    Feb 25, 2015 at 0:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.