Log on to the WordPress background as an administrator and click Settings & rarr; General. Change the WordPress address (URL) and site address (URL) to the new domain name, and click Save Changes.
Then, update the link comment link of the image in the article.
The code is as follows: |
Copy code |
UPDATE wp_posts SET post_content = replace (post_content, 'www .111cn.net ', 'www .111cn.net '); UPDATE wp_comments SET comment_content = replace (comment_content, 'www .111cn.net ', 'www .111cn.net '); UPDATE wp_comments SET comment_author_url = replace (comment_author_url, 'www .111cn.net ', 'www .111cn.net '); |
In this way, the three-condition SQL statement is written. If you use phpmyadmin to manage the database, it is better to operate it.
Phpmyadmin change domain name
1. Log on to phpmyadmin, find and open the current database, find the wp_options data table, and operate according to the figure:
Next, we can see the detailed field values of this data table in the body section on the right of the browser.
Find the WordPress installation address and blog address corresponding to the WordPress control panel background (the WordPress installation address corresponds to siteurl and the blog address corresponds to home), and follow the instructions in the figure to modify the two addresses, in this way, you can replace the blog domain name:
(Note: The pictures of ops cute are captured in the phpmyadmin local directory, and WordPress is installed in the second-level directory, so the website shown is http: // 127.0.0.1/WordPress)
Note: the "home" key value in the preceding figure can be found on the second page. You can flip the page as shown in the following figure: