I’ve found many plugins for WordPress under the GPLv2 license to stop the plugin’s auto-update.
but anyone can disable this functionality through adding minor code in functions.php
add this code in the theme functions.php file.
function disable_plugin_updates($val) {
if (isset($val->response['wc-ajax-product-filter/wcapf.php'])) {
unset($val->response['wc-ajax-product-filter/wcapf.php']);
}
if (isset($val->response['arg-multistep-checkout/arg-multistep-checkout.php'])) {
unset($val->response['arg-multistep-checkout/arg-multistep-checkout.php']);
}
return $val;
}
add_filter('site_transient_update_plugins', 'disable_plugin_updates');
“wc-ajax-product-filter” => Plugin folder name
“wcapf.php” => plugin main file. This may be different, but the most common filename like index.php
This is working for me and I’m using it. Here you need to change plugin’s main file URL to match to that of your plugin.
2nd Option:
The simplest and most effective way is to change the version of the plugin which you don’t want to get update. For an example if I don’t want WooCommerce to get updated, I open its definition file, which is like:
/**
* Plugin Name: WooCommerce
* Plugin URI: https://woocommerce.com/
* Description: An eCommerce toolkit that helps you sell anything. Beautifully.
* Version: 6.5.1
* Requires at least: 5.7
* Requires PHP: 7.2
* @package WooCommerce
*/
// Here in the Version change 6.5.1 to 100.1 like:
/**
* Plugin Name: WooCommerce
* Plugin URI: https://woocommerce.com/
* Description: An eCommerce toolkit that helps you sell anything. Beautifully.
* Version: 100.1
* Requires at least: 5.7
* Requires PHP: 7.2
* @package WooCommerce
*/
3rd Option:
Add this line to wp-config.php to disable plugin updates:
define('DISALLOW_FILE_MODS',true);
4th Option:
Disable plugin updates manually:
- Open functions.php file (go to your activated themes folder)
- Copy and paste the following code:
- Save changes, and you’re done.
remove_action( 'load-update-core.php', 'wp_update_plugins' );
add_filter( 'pre_site_transient_update_plugins', create_function( '$a', "return null;" ) );