How to disable updates for a specific plugin in WordPress

How to disable updates for specific plugin in WordPress

Sometimes you do not wish to get updates and their notification for a plugin on the WordPress updates page. Although, it is important to keep updated plugins for better security and new features. In this article, we will see how to disable updates for a specific plugin in WordPress when an update is crashing your site. We will be using the WordPress-PHP hook method.

This article is not promoting any statement about using cracked plugins. It is only to stop updates on the website if any plugin is breaking your website upon update.

Disclaimer

Problem Statement:

However, there may be a case when updating a plugin may crash your site. This way, you have to roll back the update and keep that version.

There is a simple fix that will not only disable updates for a particular plugin, but you will also not see any updates in the updates pages of WordPress.

The WordPress filter which we will use is site_transient_update_plugins.

Solution: Example – Divi Builder

In this article, we are taking an example of the DIVI Builder plugin.

Add the following PHP snippet in the theme’s functions.php file.

<?php
	// in following snippet we are stopping updates for divi builder plugin
	function filter_plugin_updates( $value ) {
	    unset( $value->response['divi-builder/divi-builder.php'] );
	    return $value;
	}
	
	add_filter( 'site_transient_update_plugins', 'filter_plugin_updates' );
?>

Here “divi-builder” is the name of the plugin’s directory and “divi-builder.php” is the main plugin file where it has plugin information.

Divi Builder – directory structure

So, the syntax is:

$value->response['pluginFolderName/mainPluginFile'];

In the following screenshot, you will see Divi Builder version 2.27.1 and its update was visible on the updates page:

Divi builder – update 2.27.1

After adding the above PHP snippet in functions.php, the update notification was removed.

divi-builder-no-update
Divi builder – disabled update

Although it is not a recommended way. Stopping updates may lead to security risks and you will also not get the latest features that were introduced in the updates.

Note:

We recommend using premium themes and plugins, and always keep them up-to-date. This will make your website secure from vulnerabilities.

Related Posts