How do I move WordPress to another location (URL)?

This page is showing a generic answer.
To see a more detailed answer customized for you, type your domain name here:

If you use the powerful WordPress CMS software on your site, it’s possible to move it from one location to another, but you have to do it a certain way. This page explains several different possibilities.

Before making any changes, you should make an extra backup of your website.

On this page:

Moving WordPress to a different location on the same site

If you’re moving WordPress to a different location on the same site, you’ll need to move the WordPress files and update the “URLs” in the WordPress database.

Tip: Let us do this for you, for free.

The instructions below explain how technically advanced customers can do this. However, the variety of themes and plugins means that in some cases, this won’t be enough, and additional changes will be necessary to get the site working.

If you’re a hosting customer of ours, we’ll be glad to do this for you at no charge: just contact us. We have the expertise to solve any additional problems with themes and plugins as a result of moving the site.

If you want to try this yourself anyway, the rest of this section explains how. You should make an extra backup first so you can restore the site if anything goes wrong.

For the sake of this example, let’s assume that you’ve installed WordPress in a folder such as “http://www.example.com/wordpress”, and you want to move it to the top level of the same site (“http://www.example.com”).

Although WordPress has instructions on their web site explaining how to do this, we recommend that you follow our instructions instead:

  1. Before you move the files, login to the WordPress administration dashboard at the old location (e.g., “http://www.example.com/wordpress/wp-admin/”).
  2. Click Settings.
  3. Change the WordPress Address (URL) to the new URL that you want to use (e.g., http://www.example.com).
  4. Change the Site Address (URL) to the same value.
  5. Click Save Changes.
  6. You’ll probably see a “404 Not Found” error page because WordPress no longer knows it’s at the old location. This is normal and can be ignored.
  7. If you’re moving the WordPress files to a location that already contains an index file such as “index.html”, “index.htm”, or “index.php”, you’ll need to move or rename the old file so the web server sees the WordPress files. We recommend moving all the existing site files into a folder called something like files-before-wordpress-move, which will also prevent them from being visited via outdated search engine links.
  8. Move the WordPress files to the new location using a shell connection, FTP connection, or some similar method. To make it go quickly, be sure to move the files instead of copying them.
  9. Login to the WordPress dashboard at the new location (e.g., “http://www.example.com/wp-admin/”).
  10. Click Settings, Permalinks, then click Save Changes without actually making any changes. (This step is necessary to update the .htaccess file with the correct “RewriteBase” rule.)
  11. Clear your browser cache and test your site.

These steps will make most WordPress sites fully work.

After moving your site, you may find that some existing menus or posts contain hard-coded link URLs that mention the old location. If you want to update them, we recommend doing this:

  1. Be sure you've made an extra backup of your website.
  2. On the new site, click Plugins / Add New.
  3. Search for: Velvet Blues Update URLs
  4. Install and activate the plugin
  5. Click on Tools / Update URLs and follow the directions.

Expert procedure: Using the shell

Again, we recommend letting us do this for you. But if you’re a technically advanced user comfortable using the command-line shell who wants to try it, this method is more efficient:

  1. Move any existing index file such as “index.html”, “index.htm”, or “index.php” out of the way as described above. Do the same with any existing “.htaccess” file.
  2. Move the WordPress files to the new location using the mv command. Be sure you move the “.htaccess” file too.
  3. Run a command like this to modify the URLs (this assumes you moved “/wordpress” to the top level of the site):
    wp search-replace example.com/wordpress example.com --skip-plugins --skip-themes --report-changed-only --all-tables-with-prefix 
  4. Run this command to update the “.htaccess” file:
    wp rewrite flush --hard
  5. Run this command to delete any cache files:
    rm -rf wp-content/cache/*

If you use the WP Super Cache plugin, you should also edit the site’s “wp-config.php” file to update the path in define('WPCACHEHOME', ....

That’s all it takes. You don’t need to use “Velvet Blues Update URLs” as described above because the “wp search-replace” command has already fixed any old URLs. Clear your browser’s cache to see the new site.

By the way, if you want to see exactly what wp search-replace will change before actually running it, try wp search-replace --dry-run --log example.com/wordpress example.com.

Moving WordPress to a different domain name where both domain names are hosted with our company

If you want to permanently move WordPress from one domain name to another, and Tiger Technologies hosts both domain names, you have three choices:

If you'd like us to move it for you, just contact us. Moving it may take up to one business day.

Moving WordPress to a different server

If you want to move WordPress to a completely different server (such as when you’re transferring a WordPress site to our company), you’ll need to actually export the WordPress data from one copy of WordPress to another.

We have a page that describes a few different ways to do this, with recommendations on when you should use each approach.

Changing the preferred domain name WordPress uses with aliases

If your WordPress site has a domain name alias pointing to it, and you want WordPress to prefer the alias domain name in links that it generates, you can update the domain name in the WordPress dashboard:

  1. Click Settings.
  2. Change the WordPress Address (URL) to the new URL that you want to use.
  3. Change the Site Address (URL) to the same value.
  4. Click Save Changes.