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

Adding Sidebar In WordPress Theme

Adding a sidebar to a WordPress theme involves modifying the theme files and registering a new sidebar area using WordPress functions. Below are the general steps to add a sidebar in WordPress themes:

How to hide particular category product on shop

To hide a particular category on the shop page using the `woocommerce_product_query` hook, you can modify the query parameters to exclude the category you want to hide. This approach allows you to customize the product query directly without modifying the main query.

Disable Automatic Login After Registration

When we enable customer registration on My Account page, We will know that when new user is register it’s automatically logged in .
it need to change when we need to manually approve each user.