If you are building a WordPress site with a premium theme and are not receiving updates, you might need to hide update notifications for WordPress. Or, if you are building a WordPress website for a client and do not want them to perform updates randomly that could potentially break customizations, you can also use this method.
However, hiding these WordPress update notifications is generally not recommended because if you go a long time without updating WordPress, whether it is the WordPress Core, themes, or plugins, it can lead to security vulnerabilities on your website.
But if you only want to hide a specific update feature, such as hiding only the WordPress plugin update feature, you can still follow the steps on this page.
How to Hide WordPress Update Notifications
Since you can update three components in WordPress (themes, plugins, and core), this guide will cover how to disable notifications for one of those updates or how to disable all update notifications.
Copy the Script to Disable Update Notifications
The first step you need to take is to copy the additional script used to disable the update notification feature.
To disable the WordPress core update notification feature, you can use this code
// Menyembunyikan notifikasi update WordPress - wpgan.comfunction wpgan_hide_core_update(){global $wp_version;return(object) array('last_checked'=> time(),'version_checked'=> $wp_version,);}add_filter('pre_site_transient_update_core','wpgan_hide_core_update'); //Menyembuyikan notifikasi update WordPress Core - wpgan.comTo disable the theme update notification feature, you can use the following code
// Menyembunyikan notifikasi update theme WordPress - wpgan.comfunction wpgan_hide_theme_update(){global $wp_version;return(object) array('last_checked'=> time(),'version_checked'=> $wp_version,);}add_filter('pre_site_transient_update_themes','wpgan_hide_theme_update'); //Menyembuyikan notifikasi update theme WordPress - wpgan.comTo hide plugin update notifications, you can use this code
// Menyembunyikan notifikasi update plugin WordPress - wpgan.comfunction wpgan_hide_plugin_update(){global $wp_version;return(object) array('last_checked'=> time(),'version_checked'=> $wp_version,);}add_filter('pre_site_transient_update_plugins','wpgan_hide_plugin_update'); //Menyembuyikan notifikasi update plugin WordPress - wpgan.comIf you want to hide all update notifications, you can use this code
// Menyembunyikan semua notifikasi update WordPress - wpgan.comfunction wpgan_hide_all_update(){global $wp_version;return(object) array('last_checked'=> time(),'version_checked'=> $wp_version,);}add_filter('pre_site_transient_update_core','wpgan_hide_all_update'); //Menyembuyikan notifikasi update WordPress Core - wpgan.comadd_filter('pre_site_transient_update_themes','wpgan_hide_all_update'); //Menyembuyikan notifikasi update theme WordPress - wpgan.comadd_filter('pre_site_transient_update_plugins','wpgan_hide_all_update'); //Menyembuyikan notifikasi update plugin WordPress - wpgan.comNow that you have the code to hide update notifications, you can add it to your theme file.
Adding Code to WordPress Configuration
There are several ways to add this code, including via FTP, File Manager, Theme Editor, using a plugin, and so on. However, we will only discuss using the theme editor here.
To add code using the theme editor, first open your WordPress dashboard, which by default can be accessed via the https://namaweb.site/wp-admin/
Once you are on the WordPress dashboard page, open the menu Appearance > Theme File Editor located in the left panel of the WordPress dashboard.
If a notification appears, you can click the button I Understand to continue the process of editing files in your theme. Once done, you can look for the file function (functions.php) to add the code.
Add the code to hide update notifications that you copied at the beginning of this article, then paste it on the very last line of the functions.php file and click the button Update File to save your changes.
After the file is saved, try refreshing your page, and now the update notification will no longer be displayed on your WordPress dashboard.
COMMENTS
Loading...