I’ve just finished changing my domain name URL for my WordPress multisite. After running WordPress as a network for nearly 2 years and managing a number of other WordPress sites, domain changes should be easy to do (but over time things get more complicated).
WordPress multisite adds a layer of complications - if you just want to update the domain URL for one of your blogs, then check out Domain Mapping plugins.
It’s fairly easily to modify the domain names for a WordPress single stand-alone install. Just go look at your WordPress settings.
Before you change your WordPress Network URL
Changing the website domain can be complicated and you need access to DNS domain management tools as well as feel comfortable with using PHPMyAdmin and editing SQL tables.
If this makes you squeamish, then you’ll probably be better of setting up a new instance of WordPress with the new domain and importing / starting from a clean install.
SQL
- Always make an EXPORT of your SQL database using DBC Backup 2 you do any of this or you will break your website. Yes, break your website as in 404, 503, database connection errors, redirects and worse search engine errors!
- You’ll need to use a MySQL editor like sequelpro or SQLyog. Editing with PHPMyAdmin can take too long.
DNS Records
- Remember to update your Domain Registration and remove any redirects or unpark the new domain you’ll want to use.
- Add the * wildcard sub-domain redirect for your new URL.
- Do delay by a day or do this on a slow traffic day if your DNS records take time to ‘flush’.
ISP Host
public_html/oldsite.com
Let’s Go Change your Multi-Site Network WordPress Site URL
wp-config.php
You only make one change here the value of
Domain_current_site
from oldsite.com to newsite.com
[php] define( ‘DOMAIN_CURRENT_SITE’, ‘damiensaunders.com’ ); [/php]
Note - adding the hack in wp-config for SiteURL or HomeURL doesn’t seem to do anything here.
wp_options
You make 2 changes here
siteurl
and
home
from oldsite.com to newsite.com
wp_blogs
WP standalone doesn’t have this table. You need to change the domain value for every single one of your blogs. I’m lucky, I’ve only got 10 blogs to change.
You need to look for and change
siteurl home
for each of your sub-blogs.
Images, Guids and other things
Once you can login - Install Search and Replace plugin and do a ‘sweep’ of your website for references to your old site name.
Be very careful with you Search and Replace ….
don’t just replace http://oldsite.com with http://newsite.com because your manual changes should have done this.
don’t replace oldsite.com with newsite.com as you’ll break folder paths etc. e.g. if your folder path is public_html/oldsite.com/wordpress then you can’t do a search & replace.
don’t change the GUIDs unless you know what you are doing!
Google Analytics & Adsense, Adwords, Feedburner
Once you’ve changed your domain name you need to update your Google Analytics and other web-tracker accounts. If you run Adwords you probably have 1/2 a day before Google will recognise and disapprove your ads.
SERP, SEO & Google Webmaster Tools
Now’s the time to read-up on 301 redirects and .htaccess rewrite rules. Afterwards, submit your new site map via Google Webmaster Tools and also follow the options to migrate your old URL to the new URL.
HELP - it’s all broken
Well no - it’s not all broken. You just have to figure out where things were changed that stop stuff working. In the first place, check your database options and look for the changes you made - maybe you overwrote URL’s in too many places.
LINKS
Change the Site URL - multisite
Tags:Read more from my blog for an introduction and quick tips on developing in Hugo or UCTD.