How to change a wordpress blog domain name

Source: Internet
Author: User
Tags php file php and change domain name wordpress blog

Change domain name from old domain name to new domain name
Method 1:

Add code to the PHP file.

Open your wp-config.php and add the following code to it, which means to set up a new Wordpress blog URL.

The code is as follows: Copy code
Define ('WP _ siteurl', 'http: // New Domain name ');
Define ('WP _ home', 'http: // New Domain name ');

Method 2:

Database modification method.

The code is as follows: Copy code
UPDATE wp_posts SET post_content = replace (post_content, 'old domain name', 'New domain name ');
UPDATE wp_comments SET comment_content = replace (comment_content, 'old domain name', 'New domain name ');
UPDATE wp_comments SET comment_author_url = replace (comment_author_url, 'old domain name', 'New domain name ');

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.