My multisite (network) installation has 3 sites.

  • the main site (nothing there, just very brief information)
  • client 1 site -- siteurl/client1
  • client 2 site -- siteurl/client2

With domain mapper, siteurl/client# changed to clientdomain.com.

Up to that point all is good. Now I want to change siteurl to mydomain.com

How do I do that?

4 Answers 4


For those of you without the required sql knowledge. The steps below can be used to change your main site url variable on a network installation.


  • Windows Operating system
  • MySQL Admin basic tasks
  • WinGrep


  1. Download mysql dump.sql of your full wordpress database
  2. While using wingrep find all matches for @url then replace with @newURL
  3. Upload the dump file with the new variables replaced
  4. Change your wp_config.php file to the newURL

You are done!


I can't add comments due to lack of rep, so I'll make it an answer..

My understanding is that the answers above will not work (or may lead to other problems down the road). That's because WordPress has a terribly annoying tendency to store data (including site URLs) in PHP serialized arrays stored in single database fields. PHP relies on the string length of each piece of data to be able to read it properly, so if you don't update the string lengths as well, you might run into issues.

There are numerous scripts and tools for helping you update your database correctly. As a programmer type, I am partial to this one: https://interconnectit.com/products/search-and-replace-for-wordpress-databases/

But I'm sure there are (much) user-friendlier versions out there.


Having said all of that, I will confess that I've moved WP sites before using a method similar to that described by Geo above, and I don't know that I've run into any issues yet. I just prefer not to take any chances with my site's data.


A very extensive search & replace (with regex if needed) in the entire db. Yes, everything. Yes, it's a pain.

  • Thanks andrea, any post that will suggest a few regex to do such thing. I am not very verse in sql queries, and I have no idea how to query a full database with one query.
    – Geo
    Feb 27, 2011 at 20:38

When searching for old URLs to replace, use the Search & Replace Plugin. If you select the "All - only search!" check box, you can use it to do a read-only search of all tables (even ones that it won't allow you to select for replace) for your old domain.

Make sure to search not only for the address, "http://<old_domain>", but also for just the domain, "<old_domain>", since some of the database columns will contain the domain without the "http://".

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.