Home >CMS Tutorial >WordPress >How to change domain name in wordpress

How to change domain name in wordpress

爱喝马黛茶的安东尼
爱喝马黛茶的安东尼Original
2019-07-15 11:23:456721browse

How to change domain name in wordpress

In fact, changing the domain name of WordPress requires going to the database for operation. First, let’s analyze several common situations of changing domain names:

1. Change the space. Domain name

1. If the above problem occurs, pack and back up all the files in the old space ftp, and enter the old site database phpmyadmin to export the database sql file of your website;

2. Upload all backed up ftp files to the new space FTP, and upload the backed up sql to the new space database phpmyadmin;

3. Open the root directory of the new space ftp website and find the wp-config.php file. Edit it (do not use txt to edit the php file), edit and configure the new database connection information;

4. Go to the database phpmyadmin in the new space and do SQL batch domain name change processing (see tutorial 2 below for details) )

Related recommendations: "WordPress Tutorial"

2. Only change the domain name, not the space

Open a new space phpmyadmin (database control panel)

Then select the new database name. After clicking, enter the 11 or more tables starting with wp_, and then select sql in the tab, as shown in the figure:

How to change domain name in wordpress

Then there are the commands for sql batch processing:

UPDATE wp_options SET option_value = replace( option_value, 'http://www.old.com', 'http://www.new.com' ) 
WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET post_content = replace( post_content, 'http://www.old.com', 'http://www.new.com' ) ;
UPDATE wp_posts SET guid = replace( guid, 'http://www.old.com', 'http://www.new.com' ) ;

old represents the old domain name, new represents the new domain name, modify the above execution statement to your own, and then Just click Execute!

At this point, everything is basically OK. . . Of course, you will encounter various problems when changing domain names. If you encounter problems, you can reply or join our technical group for help!

One-click update domain name plug-in

The use of this plug-in is recommended for novice users who have no coding experience or do not even know what phpmyadmin is. It is super fun to use. !

How to change domain name in wordpress

{GO} Click to download the plug-in, upload the plug-in, start the plug-in, go to Tools-Change Domain Name and set it up

After all settings, it will prompt that the change is successful. Finally, don’t think that everything is over. You still need to go to the WP backend - Settings - General to replace the WordPress address and site address with your new domain name URL! !

The above is the detailed content of How to change domain name in wordpress. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn