Every time WordPress releases a major version update, the dashboard always displays a prominent update notification box. Moreover, this notification box cannot be closed, making it look quite obtrusive. To remove this update notification, I researched a method that involves modifying the version number. It is very simple and practical. Next, I will explain in detail how to remove the WordPress update notification and modify the version number.
Specific Steps
Method One: Remove the Update Notification by Modifying the Version Number
- Open the file
/wp-includes/version.php. - Find the
$wp_versionvariable. - Change the value of
$wp_versionto a higher version number, for example:
Original code:
Modified:$wp_version = '4.7.0';$wp_version = '5.0.0';
This way, you not only modify the version number but also successfully block the update notification in the WordPress dashboard, achieving two goals at once.
Notes:
Although this method is simple, it is not recommended for long-term use. Especially when official important security patches are released, be sure to update WordPress promptly to avoid being attacked by hackers due to vulnerabilities.
Method Two: Remove Only the Dashboard Update Notification Without Modifying the Version Number
If you want to keep the current version number but hide the annoying update notification box in the dashboard, you can do so using the following steps:
- Open the file
wp-admin/includes/update.php. - Find the following code:
echo "<div id='update-nag'>$msg</div>"; - Delete or comment out this line of code.
After saving the changes, the update notification will no longer be displayed, while the version number remains unchanged.
Recommendations
Although hiding update notifications can make the dashboard look cleaner, WordPress updates often involve security fixes, especially patches for critical vulnerabilities. Therefore, it is recommended to regularly check the official WordPress updates and upgrade the version promptly to ensure the security of your website.
