Disabling WordPress plugin updates using PHP
Learn how to disable WordPress plugin updates to help keep any site code customization. This article shows you how to disable plugin updates using PHP.
WordPress automatically checks and prompts plugin updates if there is any available. Updating plugins might wipe off any code customisation by the developer. Therefore developers prefer to have the plugin updates disable to prevent accidental plugin updates. This article shows you how to disable plugin updates using a PHP function.
Disabling Plugin Updates
Important
Always perform a backup before you make any changes to the theme files. If you break any codes, it will be easier to revert your site to its last good known state. Alternatively, you could also create a child theme. Read this link on how to create a child theme: https://www.hosting.com/blog/wordpress-child-theme/
Follow the steps below to edit your Theme setting file to disable plugin updates in WordPress:
-
Log in to your WordPress site with an administrator account.
-
On the Dashboard in the left sidebar, click Appearance, and then click Theme Editor:
-
On the Theme Editor, select the Theme you want to edit from the dropdown:
-
The files for this selected theme are listed on the right column under Theme Files. Click on the file named "functions.php":
-
Insert the following code to the end of functions.php file and click Update File button to save the changes:
remove_action( 'load-update-core.php', 'wp_update_plugins' );
add_filter( 'pre_site_transient_update_plugins', create_function( '$a', "return null;" ) );
Related Articles
Updated 3 days ago