wp_clean_update_cache()WP 4.1.0

Deletes data about plugin, theme, and core updates from the cache.

The function removes temporary options and the current cache associated with them:

delete_site_transient( 'update_plugins' );
delete_site_transient( 'update_core' );
delete_site_transient( 'update_themes' );

No Hooks.

Returns

null. Returns nothing.

Usage

wp_clean_update_cache();

Examples

0

#1 Delete the cache of WP updates

This example shows how to remove the cache of plugin, theme and kernel updates:

wp_clean_update_cache();

Changelog

Since 4.1.0 Introduced.

wp_clean_update_cache() code WP 6.9.1

function wp_clean_update_cache() {
	if ( function_exists( 'wp_clean_plugins_cache' ) ) {
		wp_clean_plugins_cache();
	} else {
		delete_site_transient( 'update_plugins' );
	}

	wp_clean_themes_cache();

	delete_site_transient( 'update_core' );
}