Delete all transients from your WordPress multisite

2 thoughts on “Delete all transients from your WordPress multisite”

  1. Greetings, Thank you for the code. It works perfect. I added a couple more conditions to get rid of the new “nextgen gallery” crap.


    get_results( "SELECT * FROM $wpdb->blogs" );

    if ( $all_sites ) {
    foreach ($all_sites as $site) {
    $wpdb->set_blog_id( $site->blog_id );
    $wpdb->query( "
    DELETE FROM `{$wpdb->prefix}options`
    WHERE `option_name` LIKE ('_transient_%')
    or `option_name` LIKE ('_site\_transient\_%')
    or `option_name` LIKE ('displayed\_galleries\_%')
    " );


Leave a Reply to Beachbum Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.