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

Ultimate Guide to Custom Meta Boxes in WordPress

In WordPress, `add_meta_boxes` is an action hook that allows developers to add custom meta boxes to different post types’ edit screens. Meta boxes are additional sections on the post editor screen where you can add and display custom fields or other types of data related to the post.

Add Custom Taxonomy Filter on Products Dashboard.

How To Filter Products by Taxonomies in the Dashboard?

WooCommerce provide Many Product filters on admin screen , such as “Select a category”, “Filter by product type”, “Filter by stock status”.