How can I clear all my websites cache without using a plugin? Is this possible? If so then how can I do it?


  • 2
    hmmmm what cache? – Mark Kaplun Oct 17 '15 at 5:31

If this is about .css and .js changes, one way is to add "versions" of your files. For example:

script_1.0.css // This is the URL for release 1.0
script_1.1.css // This is the URL for release 1.1
script_1.2.css // etc.

Or alternatively do it after the file name:

script.css?v=1.0 // This is the URL for release 1.0
script.css?v=1.1 // This is the URL for release 1.1
script.css?v=1.2 // etc.

In wordpress you have option for versions of included JS files in wp_enqueue_script() in PHP:

wp_enqueue_script("yourscript", "joursctipt.min.js",array(),'3.3.5',true);


Also you can do that in CSS but manualy in URL:

wp_enqueue_style( 'toalc', get_template_directory_uri().'/style.css?v=1.0.5');

When you change something in your CSS or JS, just change version of your file and cache will be deleted.

If is cache of your images then you have one trick:

<img src="image.jpg?v=1">

or using PHP random string for each image to clear cache on each refresh:

<img src="image.jpg?v=<?=mt_rand(1000,9999); ?>">

Text and other forms is not stored in cache, autocomplete forms you can prevent with:

<input autocomplete="off">

NOTE: autocomplete is supported only for few browsers.

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