Menu Search
Jump to the content X X
Smashing Conf Barcelona

You know, we use ad-blockers as well. We gotta keep those servers running though. Did you know that we publish useful books and run friendly conferences — crafted for pros like yourself? E.g. our upcoming SmashingConf Barcelona, dedicated to smart front-end techniques and design patterns.

WordPress Migration: How To Move A Site Without Hassle

Moving WordPress is a task that many people find daunting. The advice on the Codex, while comprehensive, gives you a myriad of options and doesn’t describe the process simply and in one place.

When I had to move a WordPress installation for the first time, I spent hours searching online for information on the various aspects of the process, and eventually wrote myself a checklist — which I still use.

Further Reading on SmashingMag: Link

So to save you the hassle, here’s a step-by-step guide to moving a WordPress website. I’ll cover three different scenarios, which in my experience are the most common:

  • Moving a website from a subdirectory of a domain to the root directory (for example, if you’ve been using a subdirectory for development while not affecting an existing website that’s in the root);
  • Moving a website from a local installation to a remote installation; and
  • Moving a website between domains or hosts.

Before You Start Link

Before you start any of these methods, make a backup of your website:

  • Your theme files;
  • Your uploads;
  • The plugins you’ve used, so you won’t have to spend time downloading them again if things go wrong; and
  • Your database.

You can back up the database using one of a number of tools:

  • phpMyAdmin5;
  • Sequel Pro6 for OS X;
  • Terminal commands;
  • A MySQL desktop client; or
  • A backup plugin such as WP-DB-Backup237, which will provide you a copy of your database by email or download.

In this article I’ll show you how to back up your database using phpMyAdmin, as this is provided by most hosting providers and has a relatively easy-to-use interface.

If I’m going to be editing the database (which needs to be done when uploading a website or moving it between hosts or servers), I start by making a duplicate of the database and adding “old” to its name. This is the backup, and I’ll be editing the original database.

Moving A Website From A Subdirectory To The Root Link

This is by far the simplest of the three moves I’m going to cover, because you don’t actually have to move anything — or nearly anything. This method will work on a standard installation of WordPress, and will work with most frameworks, or if you’re using a parent and child theme structure.

Beware! This method will not work for multisite installations, just for standard single-site installations.

The great thing about this method is that it only takes from three to ten minutes depending on your setup — no time at all in the scheme of things.

1. Remove the Existing Website Link

If there is an existing website in the root directory, remove it. It may be another WordPress installation or it may be a static website.

If it’s a WordPress website, make a backup as detailed above, and then delete all of the WordPress files in the root.

  • If you have access to Softaculous8 or another installation service via your hosting control panel, use that to uninstall WordPress.
  • If not, use phpMyAdmin to drop (delete) the database from the existing website. See the next section for details of how to do this.
  • After dropping the database, remove all WordPress files. This normally means any files or folders beginning with wp-.
  • Beware — don’t remove the existing site until you have made a backup!

Turn off pretty permalinks in the “Permalinks” screen, which you’ll find in the “Settings” menu. Do this by selecting the “Default” option and clicking “Save Changes.”

wordpress migration9
Larger version10.

3. Change Your Website Address Link

In “Settings” → “General,” change the address of your website but not the address of WordPress. For example if you’ve been working on the website at, change the settings as follows:

  • WordPress address (URL):
  • Site Address (URL):

Save by clicking on the “Save Changes” button and move on to the next steps before trying to access your website.

4. Copy and Edit Two Files Link

Using FTP/SFTP or cPanel file manager, copy (don’t move) the following files from your WordPress directory to the root directory:

  • index.php
  • .htaccess, if you have one. If there isn’t an .htaccess file (and turning off pretty permalinks means you’re less likely to have one), don’t worry about creating one.

Edit the index.php file that you’ve moved. You could do this by:

  • Editing it in situ after the move, by using FTP/SFTP or cPanel file manager;
  • Downloading it from the subdirectory, editing it and then uploading it to the root directory — instead of making a copy.

The edit you need to make is very simple, to one line at the end of the file. You simply change this:

require ('./wp-blog-header.php) this:

require ('./subdirectoryname/wp-blog-header.php)

So if you’ve been developing in, just change the line to:

require ('./development/wp-blog-header.php)

Save the new index.php file.

Back in the WordPress admin, turn pretty permalinks on again, with whatever setting you need for your website.

Visit the root domain of your website in the browser and it will display the website that’s stored in the subdirectory, but the URL will show the root URL rather than the subdirectory URL. And that’s it!

Uploading A WordPress Website From A Local To A Remote Installation Link

This is one of the most common instances of moving WordPress. If you’re working on a local website for development and need to upload it either to go live or because you need to show a client or other team members your work, you’re going to need to upload your WordPress website. This is more complicated than moving from a subdirectory to the root directory, and involves moving three things:

  • WordPress itself — you’ll need to install this in the new location;
  • The database — which you can move using phpMyAdmin;
  • Your theme files, uploads and plugins.

Turn off pretty permalinks in the “Permalinks” screen, which you’ll find in the “Settings” menu. Do this by selecting the “Default” option and clicking “Save Changes.”

2. Backup the Database Link

Make a copy of the database and give it a new name (for example, by adding “old” to its name).

3. Install WordPress In the New Location and Upload Content Link

Using your preferred method, install WordPress on the server you want to move your website to.

Using FTP or SFTP, copy the files from your local “wp-content” directory to the remote “wp-content” directory, using the same folder structure as in your local install.

Go and have a cup of coffee. These files could take a while to upload.

4. Edit the Database Link

Don’t just open the original database file from your local installation and edit it. DB ata stored serialized will break if edited directly in a text editor. You are better off with a serialize-aware tool like Search-Replace-DB11 (thanks, Andrey Savchenko!). Replace the old, local URL for the website with the new, remote URL.

So for example, if your local URL is http://localhost/example, you would change it to

Using the “replace” command will speed this up — there could be thousands of instances. Save your new database.

5. Drop the Existing Remote Database Link

Note: This step only applies if you’ve used a script such as Softaculous or Fantastico to install WordPress, as they automatically create a new database. If you’ve installed WordPress manually, you can ignore this bit.

In phpMyAdmin, drop (delete) the database that was installed in the remote website when you installed WordPress:

  • Select the database you’re working with.
  • Click on the “Structure” tab.
  • Below the list of tables, click “Check All.”
  • In the drop-down menu which says “With selected,” select “Drop”:Dropping a database in phpMyAdmin.12
    Larger version13.
  • You will see a warning message checking that you want to drop all tables. Click “Yes.”
  • Finally you will see a message telling you that your query has been implemented:Confirmation message after dropping a database.14
    Larger version15.

6. Upload the New Database Link

While you are still in phpMyAdmin, upload the database you’ve edited:

  • Click the “Import” tab.
  • Click the “Choose file” button.
  • Select the database you saved in step 4 and click “Choose” or “OK.”
  • Click the “Go” button.
  • After a while (depending on the size of your database), you will see a message telling you the upload has successfully finished:Confirmation message after importing a database.16

7. Clear Your Browser’s Cache Link

This avoids any problems you may have if the browser has cached content from the old version of the remote database.

Your log-in details will be the same as for your local website. If you specified different log-in details when installing remotely, these will have been overridden by the imported database.

Visit the “Permalinks” screen and turn pretty permalinks back on.

You’re done!

Moving A WordPress Website Between Hosts Link

This process is almost exactly the same as that for uploading a website from a local installation. The only difference is that you need to download the files and database from the existing website.

Follow the above process, with changes to step 2:

2. Download and Backup the Old Database and Files Link

In phpMyAdmin for the old website, select the correct database and click on the “Export” tab. Download the database by clicking the “Go” button. The database will download to your machine.

Move the database out of your downloads folder to somewhere useful and make a copy of it. You’ll be working with this database in Step 4.

Using FTP or SFTP, download the contents of wp-content from your old website. You will upload this to the new website in step 3.

Now return to the original process.

Summary Link

Moving WordPress doesn’t need to be complicated. As long as you follow the steps above in the right order, your data will be safe and your website will work in its new location. Important points to remember are:

  • Always back up your website before you start.
  • If moving WordPress within a domain, you don’t need to move the whole thing, just make some changes to the settings and move and edit the index.php file.
  • When uploading your database to a new location, make sure you upload the version that you’ve edited with the new URL, not the backup version with the old URL. Otherwise, at the very least, internal links will break and it’s possible you’ll see the white screen of death when you try to install your website.

If at any stage you go wrong, undo what you’ve done and start again with your backup. You did make a backup, right?

Resources Link

The WordPress Codex includes resources that will help you apply this method whatever your hosting setup:

For help with phpMyAdmin, see phpMyAdmin’s documentation20.

There are also plugins which will help you move WordPress if you don’t want to do it all manually. I haven’t tested all of these, so I can’t vouch for their reliability or ease of use. If you do use one, do so with care.


Footnotes Link

  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 8
  9. 9
  10. 10
  11. 11
  12. 12
  13. 13
  14. 14
  15. 15
  16. 16
  17. 17
  18. 18
  19. 19
  20. 20
  21. 21
  22. 22
  23. 23

↑ Back to top Tweet itShare on Facebook

Rachel is a freelance web designer and writer specialising in mobile and responsive WordPress development. She's the author of 'Mobile WordPress Development', a comprehensive guide to making yourWordPress site mobile-friendly, published by Packt, and also author of 'WordPress Pushing the Limits', published by Wiley.

  1. 1

    Carson Shold

    April 8, 2013 8:07 am

    Some pretty good tips, but have to acknowledge that doing a simple find and replace in the SQL file for the site URL can break settings (mainly widgets and some plugin meta data).

    I suggest using this script to safely swap out any serialized strings/arrays, and remove the chance of losing settings during the switch.

  2. 2

    A great summary but thought I would just point out one issue which I discovered recently.

    When you do a simple find and replace in the database for the domain name, if the domain is stored as serialised data anywhere, like post meta, it may corrupt the value.

    I found this article by Interconnect IT about this issue and a useful script they developed to find/replace in a safe way.

  3. 3

    Viktor Solovey

    April 8, 2013 8:23 am

    4. Edit the Database – it can kill serialize ( values in the wp_options or wp_postmeta table in DB. so, think twice. You do no need “replace” URL for ALL tables in the DB maybe only for wp_posts.

    Thank you

  4. 4

    That seems like a bit of a runaround… The Duplicator plugin does this much more easily.

    You just create a Zipped package on your dev server, upload the folder by FTP to the new location, give the plugin your database credentials, and boom – you’re done.

  5. 7

    Luke Stevenson

    April 8, 2013 8:38 am

    There is a (free) WordPress Plugin which automates all of this for you. Duplicator –
    I have used this a pile of times for moving WordPress installs between servers and domains. It seems pretty much bullet- (and idiot-) proof in my experience. And so much simpler!

  6. 8

    You missed BackupBuddy. I’ve moved loads of site seamlessly with it, I’d thoroughly recommend it. And no, I don’t work for them, honestly…

    • 9

      Jared Newnam

      July 1, 2014 3:14 pm

      I don’t think one should have to pay for a backup solution with WordPress. This should be a built in feature somewhere.

  7. 10

    Excellent resource, thanks Rachel!

  8. 11

    Vitaly Friedman (editor-in-chief of Smashing Magazine)

    April 8, 2013 8:51 am

    Thanks to everyone for the feedback! The section on editing the database was updated! Sorry for any inconvenience caused.

  9. 12

    Thanks for your article. Just wanted to mention the wp-migrate-db Plugin (, which allows you to backup your DB, while change your URLs and absolute pathes.

  10. 13

    anonymous berlinerin

    April 8, 2013 8:53 am

    Just in regard to editing the database, it’s possible to make a mess of things doing it that way, particularly with serialised data, e.g. if you’re using Advanced Custom fields and have stuff in repeater fields, or just having widgets and other things disappear and having to reset them.

    I’ve been using WordPress Serialized PHP Search Replace Tool for the past year and it’s deals with this very nicely.

    Also there can be occasionally be references to absolute paths in the database, so it’s good to change those also.

  11. 14

    Christopher McInerney

    April 9, 2013 1:00 am

    Great article, could of done with it about 2 weeks ago when I had a whole host of issues exporting and importing databases. Thanks!

  12. 15

    I use wordshell (from for this kind of operations. As wordshell is a command-line tool it is easy scriptable so you can fully automate the whole procedure, less change for errors or oversights.
    It btw also makes the management of wordpress plugins, themes, backups and what have you extremely easy. Not only for one site but in principle an indefinite number of local of remote sites. Not free but worth every penny.

  13. 16

    Phil Bonhard

    April 9, 2013 6:38 am


    I’ve used BackupBuddy for backing up and moving wordpress sites. While it isn’t cheap, I did a simple calculation.

    I can do a WP move with BackupBuddy in less than 15 mins compared to doing it manually which would take a couple of hours.

    In relation to what I’d charge per hour and number of times I’ve done a backup, backupbuddy works out waaaaaay cheaper in the long run.

    Btw, I’m not associated with the company at all, I’ve just used it a couple of times and found it really handy.

    Hope this helps,


    • 17

      Jason Mathes

      April 9, 2013 7:00 am

      I’ve found the most time it takes is actually pulling the data from the old host to the new one. The actual transfer/import and startup usually only takes me about 2 minutes on average?

      But if there is a tool out there that makes it easier then definitely use it :)

  14. 18

    Jason Mathes

    April 9, 2013 6:58 am

    I just performed a move that involved Genesis. Just copy/pasted the site essentially over to the new host. Imported the Database and *poof* it was ready to go. You do have to make sure you backup and restore the entire WP Content directory though to ensure that all of the settings are saved.

    One thing to note though – I did have a “fresh” install of WordPress on the new host.

    I did have to go into the database SQL backup file and change the user name to the person who was going to be using the site (same password).

    I would suggest that you temporarily change the WordPress admin password to something simple for the move then changing it after it has been successfully moved over to the new host.

  15. 19

    George Lerner

    April 9, 2013 8:24 pm

    I have used BackWPup successfully, to back up both the database and all files. Works for WP Multi-Site. Good error reporting, rare among plugins and essential for backup (for example, tells that it doesn’t follow a folder when it is a symlink, or if it retried to make the .zip file due to a timeout).

    I learned how to move a WordPress site into WordPress Multi-Site, with all the site, widget, user, comment, SEO, and page settings intact. It’s complex… but if you have a lot of pages with SEO, or other settings, it’s a lot easier than putting all those customizations back in by hand! I’ll probably never have a “step-by-step guide”, since it takes many MySQL queries and either meticulous text editing or good PHP programming to do it, so contact me at if you need that done.

  16. 20

    Great guide! I only wish I could have read it last week before I broke the record for fastest time to break a hosted WP installation. It can be a daunting task for a newbie like myself. It can’t be said enough: Back everything up! In the absence of certainty:security.

  17. 21

    Instead of doing all of this yourself, either use Duplicator or BackupBuddy (both will make your life a whole lot easier).

  18. 22

    I Agree with AC – far too much trouble. (and far too easy to make a mistake and stuff it up!)
    Seems to defeat the purpose of why we program!
    I use BackupBuddy as I move a lot of sites, but Duplicator works well too…

  19. 23

    Checkout this WordPress backup solution that backs up your site for free and you don’t have to set it up yourself. And optionally, you can pay a monthly fee to Update your WordPess core files and plugins, monitor your website for Uptime, get email reports with website traffic statistics, and update your website menus and content:

  20. 24

    If you have SSH access between your hosts you can also use rsync. I’ve been doing this recently between my local and final production. It’s much faster than waiting for sFTP to transfer everything.

  21. 25

    Ojassvi Chawla

    April 14, 2013 8:14 pm

    Thanks Rachel, I was looking for the same.

  22. 26

    Beware! This method will not work for: Sites using Genesis as a framework (or so I’m told, I haven’t tested it myself — if you can get it to work please leave a comment below).

    Genesis are no different to other themes when it comes to moving WordPress.

    WP Migrate DB plugin is free and does exactly the same thing as premium plugins like BackupBuddy.

  23. 27


    May 3, 2013 1:28 pm

    You guys definitely need to check Infinite WP. Backup & Cloning websites with 3 clicks, No Code, No SQL. Easy.

  24. 28

    Patrick Campbell

    May 28, 2013 10:28 pm

    You know what I like to do?

    Just move the folder and add this to wp-config.php:


    • 29

      Altering the WP_HOME and WP_SITEURL in the config file will work for the admin and navigation links, but the URLs for images, etc. will still point to the previous locations which remain in the database.

  25. 30

    I thought this was wonderful – at first. Easy as pie. Then I tried to see a draft of a post or page and I no longer have permission to preview drafts. I developed inside a folder and then followed the first set of instructions above (Moving A Website From A Subdirectory To The Root).

    Did anyone else have this problem and is there a fix?

    • 31

      Rachel McCollin

      June 7, 2013 1:42 am

      Thanks for all the comments – I agree that there are plugins etc. that do this but some of them cost money and a lot of people like to be able to do things manually, oir at least understand what’s going on if they don’t actually do it themselves.

      Personally I’ve done this hundreds of times and never had any problems but thanks for the tips from those of you who have and for your suggestions too.


      • 32

        Hi Rachel,
        I am a new user to WordPress and have gone through many tormenting hours on this subject. I have a direct connection to an ftp server where I have a wordpress site I was developing within a current live website. So the url to the new WP site has /wordpress at the end. Wouldn’t I be able to just take that entire WP folder and copy it to my hard drive as a backup? Or would I still have to go through everything in your tutorial? Because every file is in that WordPress folder.

        thank you
        Marilyn Glisci

    • 33

      Rachel McCollin

      June 7, 2013 1:39 am

      Hi Cindy,

      I’m puzzled by this as moving from a subdirectory to the root shouldn’t affect your drafts or permissions at all. I can only guess it’s something to do with your hosting setup and/or your read/write permissions. You may want to speak to your hosting provider and check your .htaccess file. It’s also worth refreshing your Permalinks settings by visiting the Permalinks screen and saving your settings (you don’t have to change anything). Sometimes that works.

      I hope that helps!

  26. 34

    Thank you thank you thank you for posting this!!!!!

    I was struggling with this and thought, someone has to have done this before. I am so grateful to have been able to learn quickly through your experience.

  27. 35

    Thanks for the tutorial, just wanted to add that you can zip the folders and upload/extract them through cpanel. : )

  28. 36

    Rachel McCollin

    July 22, 2013 1:04 am

    Thanks to everyone who pointed out my error about whether this works with Genesis – as the article originally said, this was based on something I was told by a Genesis user and not based on my own testing. I’ve now completely removed that line – this method WILL work with Genesis.

  29. 37

    Glenn Ferrell

    July 22, 2013 7:52 am

    Great post Rachel! Much clearer than the Codex. One thing I noticed in the Codex under the “Moving to a New Server” heading, is that they don’t mention turning off Permalinks (although they do for the other categories earlier.) Is this step specifically targeted at getting your new .htaccess right or are there other things that could go south if you don’t do this?

  30. 38

    Alex St Clair

    August 6, 2013 1:42 pm

    Thanks, Rachel – for taking the trouble to make this so very clear and explicit. I wasted a whole day trying to replace my old HTML site with my new WordPress one. I got myself into a real mess! But your post had me out of trouble in no time. I just went back to backups and started again from scratch as you describe. Brilliant! All done in an hour.
    Thank you.

  31. 39

    Awesome. Thank you so much.

  32. 40

    I want to move my blog without actually moving anything. Let me explain:
    Currently the WP site is at: and I want the address to be at the root i.e. However, I thought the easiest way of doing this would be to change the folder mapping i.e. from “” to “”. So, the URL would change (to lose the /blog/ suffix) but I’m not physically moving anything.

    Is it just a case of changing the site URL within “Settings” → “General,” and then changing the server folder mapping?

  33. 41

    Kristi Nelson

    August 24, 2013 6:30 pm

    I followed the instructions for moving my wordpress site to the root directory. Now, the home page will not load when I set the permalinks to Post Name. All of the other pages load fine.

    The home page will load if I change the permalinks setting to Default.

    I tried changing the permalinks back to Default and deleting the htacces file and changing permalinks back to Post Name, it didn’t help.

    Any suggestions? The website is:

    Thank you,


  34. 42

    Anonymous From Finland

    August 29, 2013 8:35 am

    WordPress Move worked for me! I moved my WP site from to and I used UpDraftPlus for the backup -> restore to move the site, and after that WordPress Move did the magic for me. Thanks!

  35. 43

    I’m going to be moving a WordPress website to a new host, but the new host already has a static HTML website in place. I’ve moved sites to new hosts just by installing a new WP installation in the new host, and restoring my backup files/database. I’m not sure of what steps I need to take to move the WP site to a host that currently has a static HTML site already hosted there. (And I need to change domain names, if that matters) Any help/advice would be appreciated.

  36. 44

    Sakunne Svensson

    September 15, 2013 10:12 pm

    It’s great article but I accomplished the same task in more straitforward way(basically the same):
    – 1. Download all files
    – 2. Make a SQL copy of the database
    – 3. Put all this into same folder
    – 4. Replace: http://old-web-address –>> http://new-web address (I used DW and 1800+ replacements was made)
    – 5. Make new database & edit wp-config.php for this
    – 6. Upoad files into new location
    – 7. Import SQL into new database
    … voila (you don’t need to make old site backup, because it left untouched)

  37. 45

    I want to just say that if you want to move a wordpress site Duplicator is THE plugin to have. Its remarkably simple and easy to use and install. You don’t even have to worry about your urls.

    I moved a WooCommerce site from my localhost to the web and it did it seamlessly. I mean, it moved the products, product categories, Theme settings. EVERYTHING!!! I didn’t need to backup anything. My local site is still working as is and now I have a clone of it online. :)

  38. 46

    Thanks for the update vis-a-vis Genesis!

    I do use, Backup Buddy. It is the best. But I love learning all the step by step ways of doing it manually.

    Believe it or not, sometimes, Backup Buddy will NOT backup a site. Maybe the client’s site is screwed up. Maybe that’s why you need to move the site in the first place. So please don’t think BackupBuddy is going to save your rear end in every instance, cause it won’t. Life ain’t always that easy!

    Just sayin’ !

    p.s. but having said that, please know that I DO love BackupBuddy

  39. 47

    Thank you for this!
    I migrated my site(from a regular html site to wp) using the “Moving A Website From A Subdirectory To The Root” route. Evreything worked for all the pages but the problem I’m having is the images and pdfs i have on the site still show the…/image-name.jpg. Is there anyway to fix this? Thanks you!

  40. 48

    as they automatically create a new database. If you’ve installed WordPress manually, you can ignore this bit.

  41. 49

    Hi, Thanks for the step-by-step.

    Sorry if I’m being dense but I can’t figure out step four.

    Exactly where do you do the search and replace? In these instructions I am to do it on the desktop copy I downloaded and duplicated, but I am not to open in text editor. I am to use one of the plugins, but a plugin loaded at the destination host can’t search the SQL copy on my desktop, so I don’t get it.

    If I load it on the old hosting site, well, I already downloaded SQL, so that won’t work; so it’s the old host or the destination host but how does that help when I am supposed to replace the URLs before loading the database.

    Do you see what I mean?

    I’m probably missing something obvious.

    Thank you so much for further elucidation & patience. I appreciate it. This is my first move.

  42. 51

    David Chiapoco

    October 14, 2013 10:43 pm

    this was super super helpful, thanks for writing this up.

    all the steps worked for me

  43. 52

    Laila Chicoine

    October 16, 2013 8:04 am

    Thank you so much for this – saved me SO much time and hassle and a lot clearer than the Codex.

  44. 53

    Thank you :-)

    Clear article and helpful
    Work perfectly, you saved me much time.

  45. 54

    Ah, you absolute beauty. Am new to WordPress, so more than a touch nervous about moving the site. Followed your instructions for “Moving A Website From A Subdirectory To The Root”, for a Genesis site (using “Lisa Marie” theme), only took a few minutes, and worked perfectly, just as you described. PHEW! Massive thanks! Hugely grateful. I now owe you beer or something. :)

  46. 55

    Thanks for the Info.

    What if the new database(test site) has different prefix? ($table_prefix) should I just replace the prefix in the config.php(live site) to match the prefix in the database? wouldn’t it cause any problem?

  47. 56

    Mike Chalmers

    November 6, 2013 5:15 am

    Thanks, this helped me move a Jigoshop wordpress install to a new host. I kept the domain name but had to transfer to a temporary IP address initially – then back to the initial domain name when nameservers had been updated.

    I ran into trouble in 2 areas: the table prefix changed (I was anticipating this and corrected the new prefixes to the old ones – but the old ones had somehow changed from upper to lowercase and this caused some hassle). The other thing was changing the urls through the search script as, for some reason, I needed to do this twice to catch some URLs that had a slight difference.

    Oh and I couldn’t log in after it all seemed to work, but I needed to modify the table prefixes in the usermeta table to match the lowercase issue mentioned above.

    But feels good to get there and now I’m much more confident of doing this in the future.

    PS. I wanted to use the Duplicator plugin but it wouldn’t work with the constrictions of my host (this is the reason we are moving in the first place – incompatible plugins).

  48. 57

    I have the same question as kkrousseau:

    I’ve downloaded the database to my desktop, along with the content files.

    I’ve uploaded the contents of the content file to the new server which has WP already installed. (Thus, can’t use Duplicator Plugin)

    I’ve uploaded the search replace DB php script into the root folder in on the new server.

    In running the script, how do I edit and save the database file on my desktop? (Step No. 4)

    Then, once edited, how and where do I upload the edited database file? )Step No. 6)

    This piece of information is missing from the instructions, and as a newcomer to this process, it’s a crucial one, since I’m at a standstill in getting this site migrated.


  49. 60

    Absolutely rock solid instructions!!! I am in the IT field but am not a webdesigner by no means.

    I was able to help my client out of a bad relationship with their designer/host who gave them 24hrs to find a new host. This applied to two websites, had them back up and running in 48 hours!

    Great work and thanks for the instructions!!

  50. 61

    Guillermo Faría

    November 19, 2013 5:02 am

    since a had the same uncertainty as alvalyn & kkrousseau, i´ve decided to change a little but the order of the tasks to see what happens…
    1. Upload wp_content to destiny
    2. Drop (automatically created) DB in destiny
    3. import DB original trough PHPMyAdmin
    4. Edit imported DB using SEARCH-REPLACE-DB
    5. Hope everything went ok…(and clean cache)

    I´ll let you know the result, since I have a 1.2 GB wp_config file it´s going to take a while…

  51. 63

    how can i migrate my wordpress site to drupal. I googled a lot and found that wordpress migration tool can be used. But I didn’ get any information about its installation process and how to use it to complete migration process. Please help me.

    Thanks a lot :)

  52. 64

    I did exactly as the tutorial instructs as none of the plugins worked for me. I have the core of the site moved over, the data and product galleries (thank goodness!), however the Sidebars, Menus, and Widgets setup within the theme did not come over (and I did copy EVERYTHING under wp_content over). Any suggestions of where this is stored or how to get it moved over? The customization was extensive. We are using the Room09 Theme and we did create a child theme which was customized. Thanks!

  53. 65

    Hi Rachel, hi all,
    happy to find this helpfull page and advices after some serious research.
    My case is moving my wordpress blog/installation from a subdirectory to the main directory of my website (“” to “”). I managed to let the startpage of the domain point to the subdirectory. So far so good. But all following pages of course show the subdomain URL. And I wonder, if leaving it that way, it is not the best as it comes to SEO. And it looks a little bit weird also.
    Would be great if you have some ideas about this.

  54. 66

    I believe that finding the url and replacing is not a good idea. I have used the plugin instead to do this. Duplicator is great plugin for migration.
    Detail here
    This was quite easy to use. May be other can find it helpful

  55. 67

    Hi Rachel,
    Great blog, especially moving to a new WordPress article. Actually, I’m working on my church site, and it became badly corrupted since the server PHP was upgraded. I can’t get into the WP-ADMIN, and it’s bad. No idea what should be done. Can you like give me an advise on what may have gone wrong please?

    Fatal error: Call to undefined function wp_is_mobile() in /home/jacqueli/public_html/wp-login.php on line 39

    Your help is very much appreciated. I have no idea about WordPress actually. Learning it right now.

  56. 68

    Thanks, Rachel! This was a huge help — you made what I thought was going to be a complex challenge turn out to be really simple.

  57. 69

    thanks for the great walkthrough.

    Just thought I’d mention that I’m about to launch my new service at which will help those folks who don’t want to move the site themselves.

    The service will focus purely on moving WordPress websites from one host to another. Nothing more or less than that. It will also be priced competitively!

    Launching soon, but there is a sign-up page at the above address where folks can register for more information.

    Thanks again for the post!

  58. 70

    Nice detailed explanation, But I have a suggestion,the dropping of exiting database can cause problems. A server can host many WordPress sites and databases. Instead; creation of new database on existing server is advisable. Some readers who are running multiple databases can delete an irrelevant database. I have done the same mistake for my site which had to pull down due to such error. Thought of sharing my experience.

  59. 71

    Followed this tutorial and all is well. Just not sure about putting a 301 redirect in from the old site so as not to lose traffic etc.
    Will I get Google slap for this?
    How long do I need to leave the 301 in before I can reuse the old site for something else?
    What is the correct 301 syntax for .htaccess file?

    Thanks, in anticipation.

  60. 72

    I just did the first option, “Moving A Website From A Subdirectory To The Root.” and the site pulled up fine. But when I went back in to change the Permalinks back to “Post Name”, none of the pages (except for the home page) would pull up. If I leave Permalinks at “Default” all the pages pull up fine.

    Any ideas?

    The site in question is


  61. 73

    You helped me a lot, I can finally go to sleep. Thanks!

  62. 74

    Hi there!
    I’ve read two other articles on moving a website from subdirectory to the root.

    One from wordpress codex –

    And one from askwpgirl –

    In these other articles, there is no mention about having to turn pretty permalinks off before you make the URL site address change. In your article it says you should do so.

    Can you shed some light on why you would or would not want to turn off pretty permalinks before you make the URL update?


  63. 76

    Hi – I just migrated the new site as instructed here and it worked. But I have two problems. First, when I click on “home” from anywhere else on the new website, it still goes to “” rather than just “” and Second, when I turn permalinks on, the home page link no longer works – it takes me to a page that says page not found.

    • 77

      I have the same problem as Harmony on, if I click home from anywhere else in the site I get error 404!

      I would really appreciate help on this one, Kevin (from – new site coming soon).

    • 79

      Yes, this is a problem. When you load the root, it goes directly to the sub directory listed as your wordpress site and shows up on the URL as /subsite. All others work well. Anyone found a solution to this?

      • 80

        Fixed here by re-establishing main page as “newest posts” and making sure permalinks were correct. Done.

  64. 81

    Brett Stevenson

    April 15, 2014 1:26 pm

    Easy, just what I was after. Thanks for the article.

  65. 82

    Great article, Rachel, thanks! This is my first visit to smashingmagazine, but will not be my last.

    I am one who also wants to sing the praises of the plugin, Duplicator. I’ve used it many times now, working on my first websites, creating back up clones for testing purposes. I am commenting to add this note for those who have run into issues where they could not use Duplicator because of some issue with their hosting company. My own had a time-out issue that blocked my use of Duplicator.

    This issue was solved — thanks to the help of this wonderful plugin’s author — by uploading the package to the new site, then manually extracting the Archive/Package from within the directory via cPanel>File Manager. (Check the plugin support pages for detailed instructions.) Completely bypassed the hosting company’s limitations and worked like a charm.

  66. 83

    Anders Holm-Jensen

    May 11, 2014 12:01 pm

    Thank you so much! Simple and easy! :)

  67. 84

    I thought I had all the steps down, but your post was very helpful indeed. Worked flawlessly! Thank you!

  68. 85

    David @ HostAwesome

    May 18, 2014 6:31 am

    Awesomely in-depth! Also, keep in mind that a good number of WP hosts these days move your site free of charge to save you the hassle.

  69. 86

    Christian Kallen

    May 30, 2014 9:32 pm

    Okay, most of this worked fine, I can navigate the site with the Menu bar and all works well – except the home page. You mention the .htaccess file, but didn’t outline any changes here. When I load the default URL (without the subdirectory) I get an error message; if I go to a cached page deeper in the site I can see all the pages, except “HOME” I get the error message (too many redirects, which sounds like an htaccess error.)

    Using the Appearance/Menu does not allow a specific URL change, as outlined above. So, what should we do with this .htaccess file???

  70. 87

    Thank you Rachel so much – worked like a dream!

  71. 88


    This a very useful article/tutorial, but I guess that there are other alternatives to the “manual” migration process.

    I’ve seen several plugins like Duplicator that can help you migrate from server to server.

    I’ve also developed another plugin for this, it’s a complete solution:

    GoLive plugin has a lot of features:

    Automatically Export the Database from Source Server
    Transfering the files via FTP automatically
    Auto-import Database in Remote/destination server.
    Update .Htaccess properly
    Update wp-config.php file on destination server with the new credentials.
    Replace the URLs in Database (Posts, Pages, Menus…), and keep auto-update serialized objects too.

    I hope it helps someone.


  72. 89

    Hi Rachel/all! I just used your instructions and got to Step 5 of Moving A Website From A Subdirectory To The Root. I cannot complete Step 5 because I cannot access my WP login. For whatever reason, I’m getting 404 errors and cannot get into the dashboard. Luckily, my site moved perfectly but now I’m stuck out of editing it. I’m talking with my Hosting Help now. Any tips or thoughts? Thank you!

  73. 90

    Update: Hosting fixed the issue; however, whenever I click on a link from my page, the word “testsite” displays in the URL. Is there a way to take that out?

  74. 91

    I’m in the throws of moving my website now and I wanted to thank you for the GENIUS tip of turning off permalinks. I didn’t understand the significance of this until I tried to browse my site on the new server (without the domain name).

    Using your genius tip I was able to confirm that my site is working in both old and new locations.

    I read several tutorials and none of them suggested this.

    Thank you!


  75. 92

    Spencer Goldade

    July 7, 2014 3:27 am

    A few styles and things like that broke, but that was due to my sloppy coding in the past, which I will remedy now. Thanks so much for this helpful post!

  76. 93

    Thank u so much! This post is a life-saver.

  77. 94

    Most people wouldn’t think of it, but I used my backup plugin – UpdraftPlus – to migrate my site and it worked seamlessly, from start to finish. I didn’t need to use any other plugin or do anything else. Don’t want to push it but I really love this plugin and the support is amazing!

  78. 95

    Awesome tutorial. Thanks to you, I only took me a couple of hours to do everything and get on my new dev server running. Brilliant!

  79. 96

    Thank you for a “bullet-proof” tutorial. Just changed hosting providers and needed to move a WP site pronto. Followed your instructions and voila .. everything moved perfectly. No runs, no drips, no errors!!

  80. 97

    Followed the instruction for moving a WordPress website from a sub-directory – worked like a charm! Many thanks for your clear advice. Very pleased with our new site

  81. 98

    Whomever wrote this article is a freaking idiot and knows nothing about WordPress or programming; stop spewing bullshit.

  82. 99


    If the index file directs the user to the subdirectory installed wordpress, why do you need to even remove the one at the root/public directory?

  83. 100

    Excellent article, thank you !

  84. 101

    You should have called this “Jumping through hoops for a poorly written program!”, that would have covered it better… : )~

  85. 102

    Thank you so much! This ended up being much easier than I’d anticipated. I followed your instructions for moving the new site out of a development subdirectory to the root. Perfect.

    • 103

      As a follow-up… everything moved nicely but now I can’t get WordPress to write to the server for plug-ins, media library, etc. It WILL update a page or post, but it can’t write to the uploads folder. I’ve tried changing permissions but to no avail. I can upload directly to the server to update plugins, but when I upload images manually they don’t even show in the media library.

      Anybody experienced this or have ideas? I would appreciate any suggestions as I’ve been trying all kinds of advice found in searches for 2 days now. I have GOT to get this solved…

  86. 104

    Stefaan Van Eenoo

    November 19, 2014 5:11 pm

    Great article! Thank you so much for sharing.
    I will use this in a couple of weeks.

    Kind regards

  87. 105

    Thank you! This is a helpful and much needed article!

  88. 106

    On the strength of this post I bought your book, Rachel. WordPress – Pushing the Limits will be arriving in a couple of days. I look forward to reading it.

  89. 107

    This post really help me out from big problem. Now Im able to move wordpress site from one hosting to another hosting
    Thanks Admin

  90. 108

    I followed these steps (WP in subdirectory, web access thru the root) and the home page loads as plain un-styled html. Like if the theme or the css is not loading.

    I am using OXygen theme. Any clue anybody?


  91. 109

    Am I just supposed to “know” how to rename a database and back up a database? Are there things that web people are just supposed to “know”, like everyone else knows them except me and this is some sort of basic sql knowledge that everyone else is born with?

    You say this: “If I’m going to be editing the database (which needs to be done when uploading a website or moving it between hosts or servers), I start by making a duplicate of the database and adding “old” to its name. This is the backup, and I’ll be editing the original database.”

    “making a duplicate of the database and adding “old” to its name” – I have absolutely NO idea how to do that. There is no documentation, and everything I am finding online looks like I need a doctorate in CS to understand.

    I am using adminer to see my database stuff (tables, I guess?) and I see no button for changing a name, and no assurance that changing that name won’t break the structure or if it will just make a duplicate of the files with a new name.

  92. 110

    “Moving A Website From A Subdirectory To The Root” isn’t that a bit misleading? All your moving is the index.php. The subdirectories are left with the subdirectory URL I’d imagine this isn’t great for SEO and it looks funky.

  93. 111

    Nice article. I have also written on same topics at more elaborately.

  94. 112

    Hi! this is one of the most comprehensible and useful posts on the topic of blogger to wp migration I ever saw ( and I saw a lot since I did my research before the migration). I started out with Blogger importer, but the html thing pissed me off, and I gave up. Instead, I found an online converter that actually did the transfer, and all of my content, pics, comments and even youtube embeds went nicely over. The best part was it was incredibly quickly – about half an hour total, and the worst thing was it is for money ( but this was the best $34 I ever spent). The only thing I had problems with was redirects – I didn’t realize I could set similar URL structure on WP, so after the move I used Redirection to fix things.
    If anyone needs it, here’s the link to the tool I used:

  95. 113

    Thank you very much – I thought I was in gig trouble … I was just making it more complicated than I had to !

    Much appreciated!


  96. 114


    Thanks for the article, I used your ‘moving from a sub-directory’ method and it worked perfectly!

    I now need to move another clients from the root to a sub-directory though (so I can work on the new site in a different sub-directory). Will this method work that way around too?

    Thanks again,


  97. 115

    Santi Navarro

    March 16, 2015 8:31 pm

    I prefer migrate WordPress in manually way, without plugins.
    Anytime i had to move WP to localhost and i used next way
    Thanks for tutorial and greetings

  98. 116

    Stephanie Noel

    March 17, 2015 7:21 pm

    Does this work for a regular wordpress blog also?

  99. 117

    I found that this method worked for me with the exception of some of the settings for my plugins.
    Many of my plugins broke and I was unable to get them working again.

    I finally used and it worked flawlessly.

    I guess I am just not technical enough for this method.

  100. 118

    Michael Guthrie

    April 8, 2015 4:01 pm

    Good article and have suffered the pain of moving WP sites over the years, until I discovered the same tool I sue for Joomla sites has a WP product now making it as easy as moving Joomla.

  101. 119

    Josh Langenberger

    April 23, 2015 9:34 pm

    This post was a GOD-SEND. I have never posted a response in a site like this, but these instructions saved me so much time… I owe you a cup of coffee :)

  102. 120

    Nikki Fleur

    May 15, 2015 3:17 am

    Woow, that is a great deal of information, thank you. However, my purpose for wanting to transfer my host is because WordPress does not allow its users to post Google Ads on their site. Would you know of host that allows ads?

    • 121

      Most hosts would allow you to post Google Ads (using the AdSense programme), it’s probably just that WordPress-hosted blogs aren’t allowed to run them. Transferring to another paid host should fix that.

  103. 122

    Such a great guide, thanks for providing this. I’m new to WordPress, only know html, a bit of css, and nothing about php and databases, so this was an amazing guide. Thanks for writing it up!

  104. 123

    It WORKS !!!!
    WOW I have spend countless hours trying to copy, move..edit files, re-install WP and ended up doing a full recovery with my host. Then I followed this rules and it works..

    So simple…..
    Thanks so much!

  105. 124

    Tried your “directory to root” method and that resulted in a blank page showing up. BOO

  106. 125

    Really great post, third time I’m coming back to it now for guidance!

  107. 126

    Great post! This is by far the best post about moving WordPress website that I’ve read so far, and I read a lot of them, believe me.
    Thank you, and all the best!!!

  108. 127

    If you just want to migrate a production site to a staging website you can use a plugin like WP Staging which makes this process extremely easy and feasible for everyone:


↑ Back to top