I am creating a website, but I needed to do refresh several time to see the changes I made in website. Is there any option that I can use to disable cache in WordPress?
Asked
Active
Viewed 7.0k times
22
-
1Which cache plugin are you using? If none, then the cache will be controlled via your web hosting - which host are you with? – Mat Sep 13 '17 at 09:01
4 Answers
40
put below code in your wp-config.php file.
define('WP_CACHE', false);

Akshay Shah
- 3,391
- 2
- 20
- 33
-
3
-
-
Yes. WooCommerce. This version doesn't seem to have any way to turn off using transients. – Kraang Prime Mar 25 '18 at 14:19
-
-
Looking at wordpress documentation, there doesn't appear to be a way to disable transients. ( google comes up with results on how to clear them, but not to prevent them in the first place ). Transients are a form of 'cache' stored in wp_options table. – Kraang Prime Mar 25 '18 at 15:17
-
-
-
It might be possible that your server is having their own cache configuration contact to them – Akshay Shah Jul 19 '23 at 17:06
2
add code in your wp-config.php file.
//Add This Code In wp-config.php File To Enable Cache With Expiration
define('WP_CACHE', true); // enable the cache
define('ENABLE_CACHE', true); // enable the cache
define('CACHE_EXPIRATION_TIME', 3600); // in seconds
//Add This Code In wp-config.php File To Disable Cache
define('WP_CACHE', false); // disable the cache
define('DISABLE_CACHE', true); // disable the cache

Adam
- 147
- 1
- 13
0
If you want more fine-grained control over what pages should not be cached, which ones should and for how long, etc. or you don't want to change the wp-config.php
file, you can also try out the W3 Total Cache plugin. I have used it for quite a while now and can recommend it.

Kilian Obermeier
- 6,678
- 4
- 38
- 50
-1
Use Disable cache in google chrome developer options. Press F12, Go to Network > check disable cache.

Sajith Sajan
- 119
- 7
-
2He is referring to Server-side Caching: https://codex.wordpress.org/I_Make_Changes_and_Nothing_Happens – jaygeek Jun 10 '18 at 00:26
-
I suffered the same issue while wp plugin development.Its work fine by disabling browser caching mentioned above, – Sajith Sajan Jun 12 '18 at 08:30
-
1
-