Skip to content

Instantly share code, notes, and snippets.

@mindctrl
Created February 5, 2015 01:43
Show Gist options
  • Save mindctrl/ed6c88f0676c1dee5693 to your computer and use it in GitHub Desktop.
Save mindctrl/ed6c88f0676c1dee5693 to your computer and use it in GitHub Desktop.
Force WordPress to check for plugin and theme updates on every page load. Obviously used for testing. Do not use this full time as it will slow your site down.
<?php
/*
Plugin Name: Updates Transient Flusher
Description: Deletes the update_themes and update_plugins transients. Forces WordPress to check for plugin and theme updates on every page load. FOR TESTING ONLY.
*/
function jp_delete_update_transients() {
delete_transient( 'update_themes' );
delete_transient( 'update_plugins' );
delete_site_transient( 'update_plugins' );
delete_site_transient( 'update_themes' );
}
add_action( 'init', 'jp_delete_update_transients' );
@BrianHenryIE
Copy link

With WP CLI:

wp transient delete update_themes
wp transient delete update_plugins
wp transient delete update_themes --network
wp transient delete update_plugins --network

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment