# Disabling WordPress plugin updates using PHP

> Stop WordPress from checking for and installing plugin updates with a PHP function, for example to protect custom changes.

Source: https://helpcenter.ruachost.com/wordpress/guides/disabling-wordpress-plugin-updates-using-php/

By default, WordPress automatically checks for plugin updates and notifies administrators when new versions are available. While updates are important for security and performance, developers may want to disable them to preserve custom code modifications. On **ruachost.com**, you can disable plugin updates using a simple PHP function.

## Why Disable Plugin Updates?

- Prevents overwriting custom code changes.
- Ensures stability in production environments.
- Avoids unexpected compatibility issues with themes or other plugins.
- Gives developers full control over update timing.

## Steps to Disable Plugin Updates

1. **Log in to WordPress** with an administrator account.
2. In the dashboard, go to **Appearance → Theme Editor**.
3. Select your active theme and open the **functions.php** file.
4. Add the following code snippet at the end of the file:

   ```
   // Disable WordPress plugin updates
   remove_action('load-update-core.php', 'wp_update_plugins');
   add_filter('pre_site_transient_update_plugins', function($a) { return null; });
   ```
5. Click **Update File** to save changes.
6. Refresh your WordPress dashboard → Plugin update notifications will no longer appear.

## Important Notes

- Always **back up your site** before editing theme files.
- Use a **child theme** to preserve changes during theme updates.
- Disabling updates may expose your site to security risks apply updates manually when needed.
- Consider using a **staging environment** to test updates before applying them to production.

##
