Last update at :2024-06-24,Edit by888u
Today, Snail received reminders from several WordPress program websites to automatically upgrade to version 4.2.3 when logging in to his mailbox, because if there is a website program that is set to automatically upgrade the version, it will automatically upgrade when the official push is to the new version. , this has already appeared in the new version. If we need to set up a non-automatic upgrade, we can manually upgrade it ourselves. Snail’s personal suggestion is that if our WordPress uses a simple theme and uncomplicated plug-ins, we can set up an automatic version upgrade, so that we don’t need to wait for a new version to log in to the background to upgrade.
At the same time, we are very particular about upgrading the WordPress program version. If we numbly click to upgrade directly in the background when we see the new version, it may cause upgrade errors, and in serious cases, the website interface will become blank and incompatible. So in this article, Snail will simply share the complete and correct way to upgrade Wordpress.
First, turn on/off WordPress automatic updates
If we need to turn on and off WordPress automatic updates, we can add the following corresponding script to the current theme functions.php file.
#Turn off automatic updates of current themes, plug-ins, and translations
add_filter( \\’automatic_updater_disabled\\’, \\’__return_true\\’ );
#Automatically update small versions
add_filter( \\’allow_minor_auto_core_updates\\’, \\’__return_false\\’ );
#Large version automatic update
add_filter( \\’allow_major_auto_core_updates\\’, \\’__return_false\\’ );
#Plug-in automatic update
add_filter( \\’auto_update_plugin\\’, \\’__return_false\\’ );
#Turn off automatic updates in wp-config.php in the root directory of the configuration file
define( \\’AUTOMATIC_UPDATER_DISABLED\\’, true );
If we need to automatically update or turn off automatic updates, we can set up scripts. Under normal circumstances, it is better to update manually to avoid update errors.
Second, WordPress automatically updates
If we set up non-automatic updates, after the new version is officially pushed out, we can see a new version update prompt when logging into the WordPress program background, and we can follow the prompts to update the wizard.
However, in order to ensure that the latest version can be updated smoothly, we need to pay attention to the permission issues in the current program, because on the premise of ensuring the security of the website and server, we will separately set permissions for files and directories to prohibit writing. We You need to make sure it is turned on before upgrading, and then set it up after the upgrade is completed.
Here, we need to note that before clicking automatic update, we need to disable all plug-ins from running, otherwise it may cause plug-in incompatibility issues after the upgrade.
It is also important to note that before upgrading, whether manually or automatically, we must first back up the website database and files so that we can restore the data if there is a problem. In this way, after we click upgrade, we will automatically go to the latest version and check that there are no problems. We start the plug-ins one by one until we select some pages to see if there are any problems.
Third, manual upgrade method of WordPress program
If we don't like automatic upgrade, we can also use a more appropriate manual upgrade method, because during the entire version upgrade process, it is basically a script adjustment in the existing file, and the file will basically not change. We can replace it with a new version.
1 – Backup website
As we mentioned above, whether it is automatic or manual upgrade, we must back up the website.
2 – Update latest files
We can download the latest version from the official website, then delete the files in the wp-includes and wp-admin folders in the old website and replace them with the files of the latest package. The contents of the wp-content folder are not required. Replace, and replace everything else with the latest one.
3. Perform upgrade
After we complete the replacement, we can enter http://our website domain name/wp-admin/upgrade.php into the browser and then perform the upgrade.
After the upgrade is completed, you will see an interface like this.
Similarly, during the entire upgrade process, we can disable all plug-ins first, and then start them after the upgrade is completed, so as to ensure completeness.
To summarize, whether we upgrade the WordPress program manually or automatically, we must back up the data before upgrading. Secondly, we need to close all plug-ins to prevent compatibility issues. Wait for the upgrade before opening it. After opening it, we can update the cache and fixed links to check whether the page is complete.
Recommended site searches: asp website space, Hong Kong hosting, the cheapest dual-line space viewing IP, Hong Kong server hosting, large bandwidth server rental, domain name registration official website, foreign PHP hosting, dynamic IP server, foreign server vps, < /p>
发表评论