• Skip to primary navigation
  • Skip to main content
OsomCode

OsomCode

Awesome code tutorials for WordPress and Genesis

  • Subscribe
  • My account
    • Edit profile
    • Favorites
    • Update credit card
  • Login

Prevent automatic updates to major versions of WordPress

Find out in this tutorial how to disable WordPress from auto-updating in major versions.

WordPress 5.6 introduced quite a few new features; among them, the option (with a graphical interface) to set WordPress to update automatically.

I’m a big believer in keeping WordPress installations up to date, but enabling the option for major versions to install automatically seems too risky.

There are very few WordPress installations where I would have this option enabled. I would only leave it on blogs or personal pages that don’t have monetization.

So, since there is now a visual section where you can change this behavior (in Desktop > Updates) you might want to control it with code to prevent your client from touching it “unintentionally”.

Is this your case? Here’s how to do it:

Snippet to prevent automatic upgrade to major WordPress versions

1. Option A

Add the following code snippet to your functionality plugin:

To see this and another 839 code snippets of this website, login or subscribe here.

With either option you’re going to stop major WordPress version updates from being installed automatically.

Conclusions

Do you want to stop major versions of WordPress from installing automatically? Now you know how to do it with a simple code snippet.

If you have any question, please leave it in the comments. And if you want to give me a suggestion for future snippets, please send it through the contact form.

Benefits of being a subscriber. 🙂

Admin area PHP WordPress wp-config

To leave read and make questions about this code, you can login or register.

  • About OsomCode
  • FAQ
  • Contact

Legal Notice · Privacy Policy · Cookie Policy · Terms and conditions
Copyright © 2023

Lost your password?