Internal RWP Documentation

⌘K
  1. Home
  2. /
  3. Docs
  4. /
  5. Internal RWP Documentatio...
  6. /
  7. Articles
  8. /
  9. How to disable plugin upd...

How to disable plugin updates for a specific plugin

If a plugin has customizations that cannot be overwritten and plugin updates need to be disabled to freeze the plugin on the current version:

  1. Use the Plugin Editor or SFTP to open the main plugin PHP file (with the plugin header info, version #, etc)
  2. At the very end of the file put the following code:// remove update notice for forked plugins function remove_update_notifications($value) { if ( isset( $value ) && is_object( $value ) ) { unset( $value->response[ plugin_basename(__FILE__) ] ); } return $value; } add_filter( ‘site_transient_update_plugins’, ‘remove_update_notifications’ );
  3. Click “Update File”
  4. Go to Plugin page and refresh it a time or two and see if the update notification is gone, as well as the link “Enable/Disable auto-updates”
  5. Put a Dashboard note so everyone knows, something like:
    UPDATES ARE DISABLED FOR THE PLUGIN: “Order / Coupon / Subscription Export Import Plugin for WooCommerce”, the client has customizations in place. 2/5/21 Joseph/Jewel In the plugin’s main plugin file at the very bottom, the following code was added (remove it to re-enable plugin updates): // remove update notice for forked plugins function remove_update_notifications($value) { if ( isset( $value ) && is_object( $value ) ) { unset( $value->response[ plugin_basename(__FILE__) ] ); } return $value; } add_filter( ‘site_transient_update_plugins’, ‘remove_update_notifications’ );

Note: As mentioned above, it is likely best to put the code into the plugin that needs to be disabled itself. This ensures that code for that plugin stays with that plugin and would be removed from the website if the plugin were removed. The code would need to be slightly modified to reference the proper plugin in order to use it outside of the plugin file.

Tags ,
Still stuck? Contact

How can we help?