Connect with us

How to change your WordPress Domain?

blogging

How to change your WordPress Domain?

This is a problem that many users face sometimes, moving WordPress domains is not an easy task because you have many things to consider, if you just move your files and don’t change the correct configurations in the database you will break everything on your site, another common problem is that after you migrate to the new server your internal links (the ones created in the posts) may also be pointing to the old domain.

Now imagine if you have hundreds of posts to change? Would be to cost, time-wise, to go through all those posts changing link by link, also there are some options related to the domains and links that are created once WordPress is installed and there is no easy way to change it trough the admin.

The solution that address both of this problems is through some easy SQL queries that will do all the hard work for you:

First you need to set the new domain on your wp_option database

UPDATE wp_options SET option_value = replace(option_value, ‘http://www.old-domain.com’, ‘http://www.new-domain.com’) WHERE option_name = ‘home’ OR option_name = ‘siteurl’;

Finally, lets check through the post content and update the link

UPDATE wp_posts SET post_content = replace(post_content, ‘http://www.old-domain.com’, ‘http://www.new-domain.com’);
If you look for the database after those changes you might find some remaining text pointing to the old domain, but normally those files are transient (cache) files so you don’t have much to worry about.

That’s pretty much all you need to, for any questions or help feel free to leave a comment bellow.

Related:  Defining Affiliate Marketing

We are a WordPress plugin developer company that focuses on useful WordPress plugin creation and empowering people to earn passive incomes from their blogs. We build unique and groundbreaking plugins that will revolutionize your blog!

Click to comment

Leave a Reply

Your email address will not be published. Required fields are marked *

More in blogging

Sign up for our newsletter and get a free affiliate e-book!

About Me:

Szabi Kisded

Hi, my name is Szabi and I'm documenting my journey earning an online (semi)passive income. Learn more

Mega Plugin Bundle:

CodeCanyon Portfolio:

Online Courses:

Recommended Theme:

Popular Posts:

Latest Posts:

To Top