Disabling plugin updates
Disabling plugin updates in WordPress can be useful if you want to ensure that your site runs smoothly without any changes to plugin code.
However, disabling update checks can lead to security vulnerabilities and the possibility of an attack on your site. Also, if you do not update plugins, you may miss out on new features and bug fixes, which can reduce your site’s performance.
If you still decide to disable plugin update checks, you need to add the following code to the functions.php file of your theme ( wp-content/themes/your_theme/functions.php ):
add_filter( 'auto_update_plugin', '__return_false' );
This code will disable automatic updates for all plugins on your site.
Additionally, you can use a plugin like Disable All WordPress Updates, which disables all updates, including those for the WordPress core. However, we remind you again that disabling updates can lead to security vulnerabilities and performance issues.
Disable reminder to update all plugins
You can disable reminders to update plugins in WordPress by adding the following code to your theme’s functions.php file:
1 2 3 4 5 6 7 |
function disable_plugin_updates($value) { if(isset($value) && is_object($value)) { unset($value->response); } return $value; } add_filter('site_transient_update_plugins', 'disable_plugin_updates'); |
Disabling WordPress Core Updates
There are 2 ways to disable WP core updates:
- define(‘WP_AUTO_UPDATE_CORE’, false); completely disables automatic updates for the WordPress core. This means that no updates for the core will be installed automatically, including security updates. This method is more aggressive and less recommended since it can lead to security vulnerabilities and compatibility issues. This code should be added to the wp-config.php file in the root of your site.
- add_filter(‘pre_site_transient_update_core’, ‘__return_null’); hides notifications about WordPress core updates and doesn’t allow the system to update the core automatically, but security updates can still be installed manually. This method is less aggressive and recommended for use if you want to disable automatic WordPress core updates but still receive notifications about updates.
/* Disable automatic WordPress core updates */
define('WP_AUTO_UPDATE_CORE', false);
This code disables automatic updates for all versions of the WordPress core, including security updates. If you want to allow automatic updates only for security updates, you can use the following code instead:
/* Allow automatic updates only for security updates */
define('WP_AUTO_UPDATE_CORE', 'minor');
This code allows you to automatically update only minor updates (e.g. 4.7.x to 4.7.y) that contain security fixes, but not to automatically update to major updates (e.g. 4.x.x to 5.x.x). However, it is recommended to regularly check for WordPress core updates and update them to the latest version to ensure the security and performance of your website.
Overall, we recommend using the second method to disable automatic WordPress core updates but still allow for manual installation of security updates. Disabling WordPress core update checks is not recommended as it can lead to serious security and stability issues with your website. However, if you still want to disable WordPress core update checks, you need to add the following code to the functions.php file of your theme:
add_filter( 'pre_site_transient_update_core', '__return_null' );
This code disables WordPress core update checks and hides relevant notifications. However, we remind you again that disabling core updates can result in serious security and stability issues with your website. Therefore, we strongly recommend regularly updating the WordPress core to the latest version.
Disabling updates for all plugins and WordPress core
1 2 3 4 5 6 7 8 9 |
add_filter( 'auto_update_plugin', '__return_false' ); add_filter( 'pre_site_transient_update_core', '__return_null' ); function disable_plugin_updates($value) { if(isset($value) && is_object($value)) { unset($value->response); } return $value; } add_filter('site_transient_update_plugins', 'disable_plugin_updates'); |
If you have tried to disable plugin update reminders in WordPress using the code from my previous answer and it did not work, there are several possible reasons. Perhaps you added the code in the wrong place. Make sure that you added the code in the correct functions.php file in your WordPress theme. If you have a child theme, make sure you are adding the code to the functions.php file of the child theme, not the parent theme.
Leave a Reply