WordPress flush cache programatically
How to flush cache in WordPress programatically?
- Create "cache_clear.php" file in WordPress directory.
- Add following code
<?php
require __DIR__ . '/wp-load.php';
echo 'clearing';
var_dump(wp_cache_flush());
echo 'cleared';
?>
- If you have access to SSH - run
php cache_clear.php
- Open this page in the browser WEBSITE_URL/cache_clear.php
- After you've finished please remember to delete this file.
Check out my hassle-free WordPress hosting and WordPress Maintenance Services