By default, WordPress automatically checks for updates, installs some updates in the background, and allows file editing directly from the dashboard. While this is convenient for some, many developers and site owners prefer to have full control over when updates happen and who can edit files.
In this guide, we’ll use a few simple PHP constants and filters to:
- Disable all automatic updates
- Turn off core, plugin, and theme updates
- Block file editing from the dashboard
- Hide update notifications.
This improves security, prevents accidental changes, and ensures updates only happen when you decide.
Complete Code to Disable Updates and File Editing
Add the following code to your wp-config.php
file before the line that says:
/* That's all, stop editing! Happy publishing. */
// Disable all automatic updates
define( 'AUTOMATIC_UPDATER_DISABLED', true );
// Disable core updates (major, minor, and development)
define( 'WP_AUTO_UPDATE_CORE', false );
// Disable backend file editor
define( 'DISALLOW_FILE_EDIT', true );
// Disable file editing, updates/uploads
define( 'DISALLOW_FILE_MODS', true );
// Disable plugin and theme updates
add_filter( 'auto_update_plugin', '__return_false' );
add_filter( 'auto_update_theme', '__return_false' );
// Hide update notifications in the dashboard
add_filter( 'pre_site_transient_update_core', '__return_null' );
add_filter( 'pre_site_transient_update_plugins', '__return_null' );
add_filter( 'pre_site_transient_update_themes', '__return_null' );
How This Works
1. Disable Automatic Updates
define( 'AUTOMATIC_UPDATER_DISABLED', true );
This turns off all automatic updates for WordPress, including plugins, themes, and translations.
2. Stop Core Updates
define( 'WP_AUTO_UPDATE_CORE', false );
Prevents WordPress from updating itself automatically, whether for major or minor releases.
3. Block File Editing in Dashboard
define( 'DISALLOW_FILE_EDIT', true );
Removes the built-in theme and plugin file editor from the WordPress dashboard to avoid accidental changes.
4. Disable All File Modifications
define( 'DISALLOW_FILE_MODS', true );
This stops updates and uploads entirely, ideal for locked-down environments.
5. Turn Off Plugin & Theme Auto Updates
add_filter( 'auto_update_plugin', '__return_false' );
add_filter( 'auto_update_theme', '__return_false' );
Prevents WordPress from automatically updating plugins and themes in the background.
6. Hide Update Notifications
add_filter( 'pre_site_transient_update_core', '__return_null' );
add_filter( 'pre_site_transient_update_plugins', '__return_null' );
add_filter( 'pre_site_transient_update_themes', '__return_null' );
Removes update alerts from the admin dashboard to keep things clean.
Important Notes
- Security Risk: If you disable updates, make sure you manually check for and apply updates regularly to keep your site secure.
- Best For: Development sites, staging environments, or sites with strict change control.
- Backup First: Always back up your site before making changes to
wp-config.php
.
By using this code, you’ll have complete control over when and how your WordPress site updates — no more surprises.