WooCommerce updates should be handled carefully, as you may break some functionality that could negatively affect your site. When it comes to WooCommerce updates, there are four schools of thought amongst store owners:
- Some hit “update” without a second thought. This action can crash down your online store.
- Some store owners ignore updates altogether, treating them like they do not exist.
- Some have so many outdated plugins and themes. They are terrified of what will happen if they attempt an update.
- Additionally, some store owners run regular backups, test new releases of WooCommerce on a staging site, and then update their live site without issue.
Ideally, it would be best if you run regular backups, test new releases of WooCommerce before updating your WooCommerce store. With the right tools in place, you can keep your WooCommerce site up-to-date. However, you might want to hide update notification. You can use a staging environment to test the update, which can be provided by your hosting company.
WooCommerce Hide Update Notifications
In this brief post, I will illustrate how you can hide update notifications in your WooCommerce Store. It is also worth mentioning that WordPress is such a delicate piece of software. Therefore, you should always know what to do before actually doing it.
Developers know that the “Update Now” links are dangerous. However, other users who can access the back end of your WooCommerce store might not know that, for example, content editors.
However, there is a way you can disable the update notifications on a per-user basis. Moreover, it can be even easier if you are the only one who is seeing the notifications. The PHP snippet shared below is a little complex, but it works out.
Here are the steps that you need to follow:
- Log into your WordPress site and access the Dashboard as the admin user.
- From the Dashboard menu, click on Appearance Menu > Theme Editor Menu. When the Theme Editor page is opened, look for the theme functions file to hide update notifications on your WooCommerce store.
- Add the following code to the functions.php file:
/** * Disable Update Notifications on the WordPress Dashboard */ add_action( 'admin_init', 'njengah_hide_update_notifications_users' ); function njengah_hide_update_notifications_users() { global $menu, $submenu; $user = wp_get_current_user(); // ENTER HERE THE ONLY ALLOWED USERNAME $allowed = array( 'felixmatara' ); // HIDE WP, PLUGIN, THEME NOTIFICATIONS FOR ALL OTHER USERS if ( $user && isset( $user->user_login ) && ! in_array( $user->user_login, $allowed ) ) { add_filter( 'pre_site_transient_update_core', 'njengah_disable_update_notifications' ); add_filter( 'pre_site_transient_update_plugins', 'njengah_disable_update_notifications' ); add_filter( 'pre_site_transient_update_themes', 'njengah_disable_update_notifications' ); // ALSO REMOVE THE RED UPDATE COUNTERS @ SIDEBAR MENU ITEMS $menu[65][0] = 'Plugins up to date'; $submenu['index.php'][10][0] = 'Updates disabled'; } } function njengah_disable_update_notifications() { global $wp_version; return (object) array( 'last_checked' => time(), 'version_checked' => $wp_version, ); }
- Once you enter the code, remember to update the functions.php file. This will hide the update notifications from other users, as shown below:
Conclusion
In summary, this post shares how you can hide WooCommerce update notifications from other users on your WooCommerce store. However, it is important to note that WooCommerce updates should be handled carefully. Moreover, I highly recommend that you should run regular backups, test new releases of WooCommerce before updating your WooCommerce store.
Similar Articles
- How to Add WooCommerce Storefront Quantity Discount
- How to Add WooCommerce Storefront Product Pagination
- How to Simplify Checkout Free Items Storefront Theme
- How to Hide Errors From Visitors WooCommerce
- How to Add WooCommerce Storefront Sitemap
- How to Hide Price When Out of Stock In WooCommerce
- How to Create One Product WooCommerce Storefront Store
- How to Hide Quantity In Stock In WooCommerce
- How to Add WooCommerce Storefront Banner
- How to Change WooCommerce Storefront Layout
- How to Add WooCommerce Storefront Hero Image
- How to Hide WooCommerce Registration Form
- How to Setup WooCommerce Storefront Blog
- How to Hide Empty Category In WooCommerce
- How to Add Disclaimer Storefront WooCommerce
- How to Customize Storefront Theme Using Customizer