Pawan Kumawat

Disable plugin update in WordPress

While it’s generally not recommended to disable plugin updates in WordPress due to security and functionality improvements, there might be specific cases where you need to prevent certain plugins from updating. Keep in mind that doing so may leave your site vulnerable to security issues and may cause compatibility problems with future WordPress versions.

However, if you have a valid reason to disable updates for specific plugins, you can use one of the following methods:

Method 1: Using a Plugin
There are plugins available that allow you to disable updates for specific plugins. One such plugin is “Easy Updates Manager.” Here’s how you can use it:

1. Install and activate the “Easy Updates Manager” plugin from the WordPress plugin repository.

2. After activation, go to “Dashboard” > “Updates Options” in your WordPress admin panel.

3. In the “Plugins” section, you’ll see a list of all installed plugins. Find the plugin you want to disable updates for and uncheck the “Enable” box next to it.

4. Save the changes. The selected plugin’s updates will now be disabled.

Method 2: Using Code Snippet
If you prefer to use a code snippet, you can add the following code to your theme’s `functions.php` file or a custom plugin:

function disable_plugin_updates( $value ) {
    $plugins_to_disable = array(
        'plugin-folder/plugin-file.php', // Replace with the path of the plugin you want to disable
        'another-plugin-folder/another-plugin-file.php' // Add more plugins to disable if needed
    );

    foreach ( $plugins_to_disable as $plugin ) {
        if ( isset( $value->response[ $plugin ] ) ) {
            unset( $value->response[ $plugin ] );
        }
    }

    return $value;
}
add_filter( 'site_transient_update_plugins', 'disable_plugin_updates' );

Replace `’plugin-folder/plugin-file.php’` with the path of the plugin file you want to disable updates for. You can add more plugins to the `$plugins_to_disable` array if needed.

Please note that while this code snippet will prevent the plugin from updating, it won’t prevent WordPress from checking for updates. The plugin updates will appear as “update available” in the WordPress admin, but the updates won’t be applied when you click the update button.

Again, keep in mind that disabling plugin updates should be done with caution, and it’s generally not recommended. Keeping your plugins up to date is essential for security and compatibility reasons. If you disable updates, make sure you have a valid reason and be prepared to update the plugins manually if needed. Always backup your site before making any significant changes to your WordPress installation.

Categories

Related Blogs

Disable Repeat Purchase Of Product

To disable repeat purchase of products in WooCommerce, you can implement a custom solution using a combination of code snippets and WooCommerce hooks. The idea is to prevent customers from adding the same product to the cart if it already exists in the cart. Below are the steps to achieve this:

How to know “Who created this coupon?”

What to do when your client ask “Who created this coupon?” . in WooCommerce.  But we don’t have any default things in WooCommerce  which automatically show author of coupon .

WooCommerce: Display Regular & Sale Price @ Cart Table

Learn how to enhance your WooCommerce cart table by displaying both the regular and sale prices. Implement this functionality using WordPress hooks and filters to provide clear and appealing pricing information to your customers, encouraging sales and improving the shopping experience.