Remove Update Checks for a WordPress Plugin
While I was attending WordPress WordCamp 2010 in Chicago I met Pete Mall. He gave a great presentation titled “Beginner’s Plugin Development”. I contacted him regarding more information on how to remove the update notification you receive when a developer updates their plugin. Many of us tweak the design or internal workings of a plugin and we don’t want it updated by mistake in the future.
This may be helpful if you are running a custom version of a plugin from the repository and you don’t want to accidentally update the plugin and lose the customizations, or if you are running a private plugin and don’t want WordPress to check for updates from the plugin repository. WordPress doesn’t know if your plugin is in the WordPress plugins repository and it will request the update check on all installed plugins.
WordPress checks for updates using wp_update_plugins() in wp-includes/update.php but there are NO hooks in this function which could be used to exclude your plugin from the update check. However, you can hook into http_request_args and remove your plugin from the query arguments passed in the http request. You can add the following code to your plugin to prevent WordPress from checking for updates for your plugin:
add_filter() takes in four parameters and you can read more about it in the codex here.
add_filter( 'http_request_args', 'dm_prevent_update_check', 10, 2 );
function dm_prevent_update_check( $r, $url ) {
if ( 0 === strpos( $url, 'http://api.wordpress.org/plugins/update-check/' ) ) {
$my_plugin = plugin_basename( __FILE__ );
$plugins = unserialize( $r['body']['plugins'] );
unset( $plugins->plugins[$my_plugin] );
unset( $plugins->active[array_search( $my_plugin, $plugins->active )] );
$r['body']['plugins'] = serialize( $plugins );
}
return $r;
}
Remember you need to add the code above to only the specific plugins you don’t wish to udpate.
If you are already receiving a notice stating that your plugin needs to be updated. A value called “_transient_update_plugins” in the WordPress database is the reason. To do this insert the following command into your wp-includes/update.php file at the top. Refresh your plugin list page and remove the snippet after the database is updated.
get_site_transient( 'update_plugins' ); // unset the plugin set_site_transient( 'update_plugins', '' ); // reset plugin database information
While using this solution I realized I can only use it on one plug-in per WordPress installation without writing additional code. I thought a WordPress plugin sure would be nice. Here is a current plug-in by a group of guys. Several of them I have meet. WP Manage Plugins It has a weird interface issue on the admin side. For support please visit the Support Forum.
I hope this helps save you time!
Related posts:
![[Return to HOME] web design solutions](/images/logo_body.jpg)

It should be
set_site_transient( 'update_plugins', '' )to clear the cache or you can unserialize and iterate through it and unset it for your plugin.Thanks for the tip I have the post updated.