If you are a WordPress developer, or you just drafted your WordPress based site on a local machine and want to move it to its final location / domain, then you will most probably need to change all the links in your posts, pages, media … basically everywhere.
Luckily there is an easy solution for that. Read further to find out how to move your WordPress site to a new domain in 2 minutes.
Changing the URL under Settings > General is one step, but it is not enough. And it shouldn’t be the first step!
What you need is the Velvet Blues Update URLs plugin for WordPress. Go ahead, install and activate it! It will make moving your site a child’s play.
To make the sitemove trouble free, do the following:
- Create a backup from your site. Just in case.
- After installing the Velvet Blues plugin go to Tools > Update URLs.
- Enter your current (old) URL with http:// and everything in the appropriate box (e.g. http://webdev.divi-magazine.com or http://127.0.0.1/divi-mag/)
- Then enter your new URL in the below field (e.g. https://divi-magazine.com/)
- Make sure they are correct!!!
- Check the appropriate checkboxes indicating which URLs should be updated. (I usually check all, EXCEPT the last one.)
- Hit the blue update button.
- Now go to Settings > General and enter your new URL into the 2 fields and hit ‘Save changes’. This will log you out. (And your site will likely be inaccessible until you finish the next step.)
- Move your site to the new location / domain.
- And you are set.
Sounds easy, no? Well, because it is. All your links are cared for. Beside the time needed to move your files to a new location, the whole procedure takes about 2 minutes.
Thanks to the creators for this excellent plugin. Deserves 5 stars!
In case you run into any trouble during the process (you never know, it can happen), and cannot log in any more, because the domain is already changed under Settings > General then don’t despair. Go to your database (I use phpMyAdmin) and open your Options table. You will need to change the option_value where the option_name is ‘siteurl’ and ‘home’. Then you can redo the above process.
Note: I tested it with WordPress 4.1 and works as expected.
This looks pretty good. I’m surprised I haven’t encountered it before. Thanks.
Hi Ollie,
Your welcome! Let me know if it worked out for you.
In honesty an opportunity to test it isn’t on the horizon. I’ll bookmark it for future reference though!
thanks for this – looks too good to be true…
just to clarify though, step 9 – when you say “move your site to the new location” you mean transfer the folders (and database?) to the new location, i.e. via FTP. Right?
Hi Doro,
That’s exactly what I mean. Copy the files via FTP and move the database.
Also what I do sometimes – maybe not the best practice, but works – is that I set up the site under a subdomain, i.e. http://webdev.mydomain.com
So when the site is done for going live, then I don’t need to copy anything anywhere, just do the steps from 1 to 8.
Hope this helps!
Excellent. Will give it a try! thanks a lot.
Please let me know how it worked out!
Hm, not sure if I fully understand the subdomain thing. How do you switch from http://webdev.mydomain.com to http://www.mydomain.com then when you want to go live with the site? And where do you have the WordPress installation?
Thanks!
Peter
Hi Peter,
Sorry for the late reply.
One of the hosting providers I use allows the easy setup of subdomains. Basically I can set up any subdomain and set it to point to a specific directory on the server. And I can do the same with the domains as well.
So when I start the development I set up webdev.mydomain.com to point to a directory (let’s call it “/clientsite”) and I install WordPress there. And domain.com I don’t point anywhere, or I point it to a different, empty directory.
Once I’m done with the development, I remove the subdomain and I point domain.com to the directory “/clientsite”. (This is step 9 in the process basically.) And you are done.
Hope this helps. Let me know if you need any more info.
I’ve tried it and it works like a charm!! Thanks!!
I want to transfer my wp site from a sub-domain where I’ve been developing it, to the main domain where I have the current html site. I’m planning on deleting the html site, but I’m a little confused about the instructions on how to transfer the wp database to the main domain. I’m not sure exactly where it is. Is it with all the other files that I have in the sub-domain? Can I just copy and paste all my wp files over to the public_html folder on the main domain? This is my first wordpress website, so I’m still learning how everything works.
Thanks,
Hi Heidi,
That all depends on how your “system” is set up. If the database of the subdomain is running in the same database as for the main domain, then you don’t need to do anything, just move the site. If your main site is also running on WordPress, then you can check the wp-config.php file. If the following settings are the same, then you can just do the move as instructed in the post and all will be fine:
define(‘DB_NAME’, ‘yourdbname‘);
define(‘DB_USER’, ‘yourdbusername‘);
define(‘DB_PASSWORD’, ‘yourdbpassword‘);
define(‘DB_HOST’, ‘yourdbhost‘);
If the DB_HOST is the same, but the other 3 are different, then you will need to change the other 3 to the values of the main site, and you don’t need to touch the database.
Let me know if you need more help.
If the database is on a different server, then the move is also possible, just requires some handwork. Or an easier way is to use a backup / migration plugin like UpdraftPlus (premium version is needed for migration) or iThemes Backup Buddy. I’m sure there are also free ones, but I don’t have experience with those.
My current website is an html website. So I guess I will just delete everything and copy all the website files over to the public_html after I change the 2 permalinks. I am moving it from a subdomain to the main domain on the same server. But I am confused about where the database for wordpress is, and how to move it if it is somewhere else.
For the files: yes, it should be as simple as copying everything to public_html. Don’t forget to make a backup from the ‘old’ site.
For the database: if your subdomain is on the same server, only in a different directory than your main domain, then the database will not need to be moved or changed, so you don’t need to worry about it.
Then just follow the steps in the post and you are done.
PS: If you want to go for supersure, then you can ask your provider on your database, but it should be fine.
One action that I believe you should add to this process is to disable all plugins before you do the backup (and for sure before you change the urls and the website urls).
I did not do that when using your process. When I got to the new site, WP SuperCache was broken, but more importantly, the Google Captcha plugin I was using to protect login’s was broken because the domain name was new. I was completely locked out of the website that was not working. Fortunately a support person at GoDaddy knew to go into the database and disable all of the plugins, and I was able to get in and make it work properly.
Thanks for the basic idea as it did work quite well.
Hey Hubbs,
Thanks for your comment!
Yes, you are right, there might be cases when deactivating the plugins is needed. I believe in your case it was simply the caching. Maybe only disabling that would have already solved the issue.
Nonetheless, thanks again for your input!
Cheers
Thank You! This fixed my problem!
This sounds great, but a concern is how does it handle child themes? I’m running my site inside a child theme. Is there anything special you have to do to take this into account?
Hi Dave,
Nothing special with child themes. It should transfer normally, without any issues.
I tried this and the entire site is now gone!
Anyone know what might have happened?
The old URL is:
http://rosecreative.net/wordpress1/
The new URL is:
http://rosecreative.net/
Site hosted under NetworkSolutions.com
Thanks!
Hi Jerges,
I’m sorry about your site being gone, that’s terrible.
I’m not quite sure what has happened, as I don’t know what steps you took and how far you got.
On the old URL I get 500 error.
On the new URL I get a password protected site.
Things you can check / do:
Let me know if any of this helps.
Cheers,
Andras
I also lost my site when I followed these directions, but then I just copied all the files to the newwebsite.com folder via ftp and it worked beautifully- thanks so much!
Hi Mindy,
I guess you got scared after step 8, and did step 9 (I just copied all the files to the newwebsite.com folder) and started working.
Happy I could help.
Cheers,
Andras