• 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

Hide the option to automatically update WordPress themes

Find out in this tutorial how to hide the option to enable (or disable) automatic theme updates in WordPress using code.

WordPress 5.5 introduced quite a few new features, among them, the option to indicate that themes should be automatically updated:

activate-option-update-automatically-theme-WordPress

If you are managing client sites you may want to hide this option from their view to avoid possible mistakes.

Luckily, there is a WordPress filter that allows you to modify this. Here’s how:

Snippet to hide the option to automatically update themes in WordPress.

Add the following code snippet to your functionality plugin:

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

With the first fragment you get that the option is not shown to any user.

remove-option-update-automatically-wordpress-theme

In the second, instead, you place a conditional so that this restriction does not affect your user and, in this way, you can see the option to enable or disable theme automatic updates.

In the snippet, your user is identified by ID=1.

If this is not your ID, please change it!

If you don’t know how to get the ID you can take a look at the tutorial on how to display the user ID in the WordPress admin.

Remember that this does not prevent updates from being done automatically (if enabled), but simply hides the option to modify it from the themes page.

Conclusions

Do you want to hide the option to modify the behavior of theme updates in WordPress? Now you know how to do it with a simple code snippet.

In fact, you can hide it for all users or leave it visible only for you, if you wish. A good practice if you want to avoid customer-related scares. 😉

Any questions? I read you in the comments.

And if you want to give me any suggestion for future tutorials, leave it in the contact form. Advantages of being a subscriber. 😉

Admin area Child Theme PHP WordPress

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?