Move WordPress to New Domain

Last Updated on August 16, 2023 by Humera Hallari

For you, Bloggers may have asked how to move your WordPress blog to a new domain. This could happen maybe because your old domain isn’t good for branding, or your old domain has other problems so inevitably you really want your blog moved to a new domain.

The problem is, your old blog has been configured with the old URL, so you’ll need to change all the old URL configuration to the new URL/domain. This you can do in a very fast way through SQL commands in the database, so that all configurations like in tables, wp_options, wp_posts, and wp_postmeta can be updated to adjust to your new domain.

If you are experiencing the problem as I mentioned, then here is a tutorial on how to move your WordPress blog to a new domain by reconfiguring your old WordPress blog database.

Steps to move WordPress blogs to a new domain:

  1. Before moving your old WordPress blog to a new domain it helps you first backup the database and web files to prevent errors during your WordPress configuration process because in this tutorial you will move the old blog to a new domain by changing it through the database. You can backup files and web databases via CPanel or according to the way/method provided by your hosting service.
  2. Go to CPanel hosting where your WordPress files are stored, then look for a menu called PhpMyAdmin. If you are using a VPS (Virtual Private Server) you can also ask how to get into your PhpMyAdmin.
  3. Once you have entered the PhpMyAdmin page, then look for your database name such as “db_wordpress“. after your database is met, click the database and go to the “SQL” menu, in the command field provided the execution of SQL commands following the line just let’s not take too much time.
[sql]UPDATE wp_options SET option_value = replace(option_value, ‘http://www.old-url.com’, ‘http://www.new-url.com’) WHERE option_name = ‘home’ OR option_name = ‘siteurl’;
UPDATE wp_posts SET guid = replace(guid, ‘http://www.old-url.com’,’http://www.new-url.com’);
UPDATE wp_posts SET post_content = replace(post_content, ‘http://www.old-url.com’, ‘http://www.new-url.com’);
UPDATE wp_postmeta SET meta_value = replace(meta_value,’http://www.old-url.com’,’http://www.new-url.com’);[/sql] [Important]: Replace “http://www.old-url.com” with your old domain URL, and replace “http://www.new-url.com” with your new domain. Look at the following screenshot example.

  1. Done, after you execute those SQL commands, your old WordPress blog has been configured with a new domain, so your only task is to redirect your new domain to your hosting nameservers and add them via the domain Add-ons. What if you want to move to another hosting as well? Just upload the files and databases to the new hosting, but don’t forget to adjust the database configuration in the file “wp-config.php” your WordPress blog.

That’s a tutorial on how to move an old WordPress blog to a new domain. If you are still confused and have something to ask you can send it via comments.

1 thought on “Move WordPress to New Domain”

Leave a Comment