How To Disable WordPress Theme Update Notification (No Plugin)
After setting up a WordPress theme, updates are not very necessary unless they are security updates. This was the case for one of our clients, hence the need to disable WordPress theme update notification that kept popping up annoyingly.
Note: This tutorial uses the Twenty Twenty One WordPress theme.
You can disable the WordPress update notification/nag for an individual theme with the following code snippet added to your theme’s functions.php:
1 2 3 4 5 6 7 8 9 10 |
/** * Disable individual theme update notification WordPress */ function disable_theme_update_notification( $value ) { if ( isset( $value ) && is_object( $value ) ) { unset( $value->response['twentytwentyone'] ); } return $value; } add_filter( 'site_transient_update_themes', 'disable_theme_update_notification' ); |
Make sure to replace the Twenty Twenty One (twentytwentyone) value with your specific theme’s text domain substitute.
You can find your theme’s text domain by:
- Login to your WordPress dashboard
- Go to the Appearance menu option on the Admin menu
- Select the last option, Theme Editor
- On the Stylesheet (style.css) file, search for the text domain.
- That is your WordPress theme’s text domain.
Here is an image of the same:
You can read more about the text domains here.
This snippet added to functions.php or a custom plugin will hide/disable the update notification for a single individual WordPress theme.
Article based off Red Bridge Internet’s tutorial.
Recommended Posts
How to Hide Featured Image in Single Post on WordPress
October 8, 2020
How to Track WordPress Site Searches in Google Analytics
October 6, 2020