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

WooCommerce: Get Product Info (ID, SKU, $) From $product Object

In WooCommerce, the `$product` object represents a single product, and it contains various information and methods that you can access to get details about the product. Here is a list of common product information that you can retrieve from the `$product` object:

How To Add Sub Menu In WordPress Admin Panel

How to add sub-menu in WordPress admin panel – In this post we see how we can add custom sub-menu to admin sidebar. Sometimes when we on WordPress and we need to show some features or any information in admin page then we can use this code snippet to create the same.