{"id":46623,"date":"2026-10-10T17:17:37","date_gmt":"2026-10-10T17:17:37","guid":{"rendered":"https:\/\/summer-heart-0930.chufeiyun1688.workers.dev:443\/https\/code.dplugins.com\/?p=46623"},"modified":"2026-10-11T05:17:57","modified_gmt":"2026-10-11T05:17:57","slug":"disable-wordpress-automatic-updates","status":"publish","type":"post","link":"https:\/\/summer-heart-0930.chufeiyun1688.workers.dev:443\/https\/code.dplugins.com\/disable-wordpress-automatic-updates\/","title":{"rendered":"Disable WordPress Automatic Updates but Keep Security Fixes"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Automatic updates can break a working WordPress site, and you usually find out when a client reports it. Disabling WordPress automatic updates completely has its own risk: a site that misses a security release is an easy target. This snippet stops the updates that tend to break things, major core versions, plugins and themes, and keeps minor core releases, which are the security and maintenance fixes.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">The snippet<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">&lt;?php\n\/**\n * No automatic major core, plugin or theme updates.\n * Minor core releases (security and maintenance fixes) still install automatically.\n *\/\nadd_filter( 'allow_major_auto_core_updates', '__return_false', 100 );\nadd_filter( 'allow_dev_auto_core_updates', '__return_false', 100 );\nadd_filter( 'auto_update_plugin', '__return_false', 100 );\nadd_filter( 'auto_update_theme', '__return_false', 100 );\n\n\/\/ To stop security releases too, uncomment the next line (not recommended):\n\/\/ add_filter( 'allow_minor_auto_core_updates', '__return_false', 100 );<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">How it works<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>allow_major_auto_core_updates<\/code> decides whether WordPress may move to a new major version on its own (for example 6.8 to 6.9). Returning <code>false<\/code> keeps the site on its branch until you update from <strong>Dashboard \u2192 Updates<\/strong>.<\/li>\n\n\n<li><code>allow_dev_auto_core_updates<\/code> does the same for beta, RC and nightly builds on development installs.<\/li>\n\n\n<li><code>auto_update_plugin<\/code> and <code>auto_update_theme<\/code> are asked for every plugin and theme before a background update. Returning <code>false<\/code> overrides the &#8220;Enable auto-updates&#8221; links, and the Plugins and Themes screens show auto-updates as disabled.<\/li>\n\n\n<li>Minor releases (6.8.1 to 6.8.2) are decided by <code>allow_minor_auto_core_updates<\/code>, which the snippet leaves alone.<\/li>\n\n\n<li>Priority <code>100<\/code> wins over plugins that switch updates back on at the default priority.<\/li>\n\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">The older One-Click Import version returned <code>false<\/code> from <code>auto_update_core<\/code>, which blocked security releases as well and left plugin and theme auto-updates untouched.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Add it with Scripts Organizer<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">In <a href=\"https:\/\/summer-heart-0930.chufeiyun1688.workers.dev:443\/https\/dplugins.com\/downloads\/scripts-organizer\/\">Scripts Organizer<\/a> go to <strong>Code Blocks \u2192 Add New<\/strong> and give the block a name. Set <strong>Trigger location<\/strong> to <strong>Everywhere<\/strong>, tick <strong>PHP<\/strong> under <strong>Script location<\/strong>, paste the code into the PHP editor and publish. Leave <strong>Action\/Hook<\/strong> empty. Do not use <strong>Admin only<\/strong>: background updates run during WP-Cron, which is triggered by front-end visits and <code>wp-cron.php<\/code>, not by wp-admin, so Admin only code would not be loaded when the updater makes its decision.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">An mu-plugin is an even safer home for this one, because it can&#8217;t be switched off by accident.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The same code also works unchanged in a small plugin or an mu-plugin.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Customise it<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Allow plugin auto-updates again: delete the <code>auto_update_plugin<\/code> line.<\/li>\n\n\n<li>Allow one plugin only: replace <code>__return_false<\/code> for <code>auto_update_plugin<\/code> with a function that returns <code>true<\/code> when <code>$item-&gt;slug<\/code> is that plugin&#8217;s slug and <code>false<\/code> otherwise.<\/li>\n\n\n<li>Stop security releases too: uncomment the last line. Only do that on sites you update by hand every week.<\/li>\n\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">To hear about security releases by email, see <a href=\"https:\/\/summer-heart-0930.chufeiyun1688.workers.dev:443\/https\/code.dplugins.com\/wordpress-security-updates-email-alert\/\">WordPress Security Updates Email Alert Without a Plugin<\/a>. To hide update checks and notices altogether, see <a href=\"https:\/\/summer-heart-0930.chufeiyun1688.workers.dev:443\/https\/code.dplugins.com\/disable-wordpress-core-plugins-and-themes-updates-and-admin-notices\/\">Disable WordPress Core, Plugins and Themes updates and Admin Notices<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Gotchas<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>This only controls automatic updates. Manual updates still work.<\/li>\n\n\n<li><code>AUTOMATIC_UPDATER_DISABLED<\/code> in wp-config.php switches off every automatic update, security releases included, before these filters are asked. Check wp-config.php if minor releases stop arriving.<\/li>\n\n\n<li>Managed hosts often run their own updater outside WordPress; check the host&#8217;s control panel as well.<\/li>\n\n<\/ul>\n\n","protected":false},"excerpt":{"rendered":"<p>Disable WordPress automatic updates for major core versions, plugins and themes, while minor security releases keep installing on their own.<\/p>\n","protected":false},"author":1,"featured_media":46907,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"slim_seo":{"title":"Disable WordPress Automatic Updates but Keep Security Fixes","description":"Disable WordPress automatic updates for major core versions, plugins and themes, while minor security releases keep installing on their own."},"_slim_seo_primary_term_category":0,"_slim_seo_primary_term_post_tag":0,"footnotes":""},"categories":[131,3],"tags":[94,166,144,145],"dpc_library":[204],"class_list":["post-46623","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-production","category-wordpress","tag-core","tag-scripts-organizer","tag-security","tag-updates"],"_links":{"self":[{"href":"https:\/\/summer-heart-0930.chufeiyun1688.workers.dev:443\/https\/code.dplugins.com\/wp-json\/wp\/v2\/posts\/46623","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/summer-heart-0930.chufeiyun1688.workers.dev:443\/https\/code.dplugins.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/summer-heart-0930.chufeiyun1688.workers.dev:443\/https\/code.dplugins.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/summer-heart-0930.chufeiyun1688.workers.dev:443\/https\/code.dplugins.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/summer-heart-0930.chufeiyun1688.workers.dev:443\/https\/code.dplugins.com\/wp-json\/wp\/v2\/comments?post=46623"}],"version-history":[{"count":1,"href":"https:\/\/summer-heart-0930.chufeiyun1688.workers.dev:443\/https\/code.dplugins.com\/wp-json\/wp\/v2\/posts\/46623\/revisions"}],"predecessor-version":[{"id":46668,"href":"https:\/\/summer-heart-0930.chufeiyun1688.workers.dev:443\/https\/code.dplugins.com\/wp-json\/wp\/v2\/posts\/46623\/revisions\/46668"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/summer-heart-0930.chufeiyun1688.workers.dev:443\/https\/code.dplugins.com\/wp-json\/wp\/v2\/media\/46907"}],"wp:attachment":[{"href":"https:\/\/summer-heart-0930.chufeiyun1688.workers.dev:443\/https\/code.dplugins.com\/wp-json\/wp\/v2\/media?parent=46623"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/summer-heart-0930.chufeiyun1688.workers.dev:443\/https\/code.dplugins.com\/wp-json\/wp\/v2\/categories?post=46623"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/summer-heart-0930.chufeiyun1688.workers.dev:443\/https\/code.dplugins.com\/wp-json\/wp\/v2\/tags?post=46623"},{"taxonomy":"dpc_library","embeddable":true,"href":"https:\/\/summer-heart-0930.chufeiyun1688.workers.dev:443\/https\/code.dplugins.com\/wp-json\/wp\/v2\/dpc_library?post=46623"}],"curies":[{"name":"wp","href":"https:\/\/summer-heart-0930.chufeiyun1688.workers.dev:443\/https\/api.w.org\/{rel}","templated":true}]}}