How to transfer a WordPress blog to a different domain?

Let’s say we are currently hosting our WordPress blog on certain domain and would like to move it to a new domain. How to do this with the least hassle and SEO hit?

Are there any plugins that could help with this? (for example providing automatic cross-domain 301 redirection or similar)

4 s
4

I recommend handling the 301 redirect in your web server rather than in WordPress. mod_rewrite or RedirectMatch will be much more efficient than spinning up WordPress to deliver a Location: header.

<VirtualHost *:80>
    ServerName busted-cheap-url.com

    # mod_alias
    RedirectMatch permanent (.*) http://great-new-url.com$1

    # OR mod_rewrite
    RewriteEngine on
    RewriteRule (.*) http://great-new-url.com$1 [R=301]
</VirtualHost>

There are several methods for changing the blog URL; I tend to prefer setting a new WP_HOME and WP_SITEURL in wp-config.php as a quick fix, and running SQL commands in the database as a more permanent solution.

See also:

  • Changing The Site URL
  • Easily Move a WordPress Install from Development to Production?, which recommends several ways to move a blog to a new URL

Leave a Comment