Skip to main content

Disable Auto Updates

PropertyValue
descriptionDisable automatic WordPress core, plugin, and theme updates.
tagslib, php, wp, oop
rating

Overview

Disable WordPress automatic updates for core, plugins, and themes.

The snippet disables the automatic updater subsystem, prevents forced item updates, and returns false for core, plugin, and theme auto-update filters. Manual updates through the dashboard or deployment workflow are still possible.

Variants

<?php
/**
* Disable WordPress automatic updates.
*/

/**
* Disable automatic updater subsystem.
*/
if ( ! function_exists( 'mac_disable_automatic_updater' ) ) {

function mac_disable_automatic_updater(): bool {
return true;
}
}

add_filter( 'automatic_updater_disabled', 'mac_disable_automatic_updater' );

/**
* Prevent forced auto-updates.
*/
if ( ! function_exists( 'mac_disable_forced_auto_updates' ) ) {

function mac_disable_forced_auto_updates( mixed $forced, mixed $item ): bool {
return false;
}
}

add_filter( 'wp_is_auto_update_forced_for_item', 'mac_disable_forced_auto_updates', 10, 2 );

/**
* Disable core auto-updates.
*/
if ( ! function_exists( 'mac_disable_core_auto_updates' ) ) {

function mac_disable_core_auto_updates( mixed $update, mixed $item ): bool {
return false;
}
}

add_filter( 'auto_update_core', 'mac_disable_core_auto_updates', 10, 2 );

/**
* Disable plugin auto-updates.
*/
if ( ! function_exists( 'mac_disable_plugin_auto_updates' ) ) {

function mac_disable_plugin_auto_updates( mixed $update, mixed $item ): bool {
return false;
}
}

add_filter( 'auto_update_plugin', 'mac_disable_plugin_auto_updates', 10, 2 );

/**
* Disable theme auto-updates.
*/
if ( ! function_exists( 'mac_disable_theme_auto_updates' ) ) {

function mac_disable_theme_auto_updates( mixed $update, mixed $item ): bool {
return false;
}
}

add_filter( 'auto_update_theme', 'mac_disable_theme_auto_updates', 10, 2 );