Switching URLs in WordPress

When moving sites from development to production, one important part of the moving is changing the domain name WordPress recognizes and throughout all the content. Unfortunately in WordPress, there isn’t one place in the administration tool to change the website domain name everywhere, despite the ‘WordPress address’ and ‘Site address’ options in General Settings. These settings miss all internal links throughout content stored in the database.

To replace all URLs stored in the database, I use interconnect/it’s Search and Replace Script in PHP. Follow their instructions and be sure to delete the file from your new site after the URL switch is complete. This script replaces and fixes urls within serialized data, which is important for WordPress sites.