Force WordPress security upgrade to latest minor version

Create a file in the WP root directory called force-minor-update.php and call it via your web browser.

Use this code:

require( dirname(__FILE__) . '/wp-load.php' );

//Clear transients
global $wpdb;
$sql = "DELETE FROM $wpdb->options WHERE option_name LIKE '_transient_%'";
$clean = $wpdb->query( $sql );

//Clear object cache
wp_cache_flush();

//Attempt auto update
wp_maybe_auto_update();

Original source

2 thoughts on “Force WordPress security upgrade to latest minor version

  1. DrLightman

    If you want to use the underscore in like sql statement as a literal, you have to escape it, otherwise it works as a single character wildcard. Maybe there you have to escape with two backslashes since it’s inside a php string too.

    Reply

Leave a Reply

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

Markdown is allowed in comments.