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.

    Cheerz

    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