How to purge all transient caches?

Is there an easy way to delete all transient caches? A plugin maybe? Or like in drupal “drush cc all”?

3 Answers
3

Not tested, but if you need a quick and dirty way, you could put a script like this in your WordPress folder and call it each time:

define( 'WP_USE_THEMES', false );
require('wp-blog-header.php');

global $wpdb;
$wpdb->query( "DELETE FROM $wpdb->options WHERE option_name LIKE '%\_transient\_%'" );

Not to be used on a production server.

Leave a Comment