I was developing website on test.example.com on a separate server. Meanwhile, the working server was example.com at GoDaddy.

The WordPress website was working fine on both servers. But then I changed the registrar and decided to change the WordPress on test.example.com to example.com inside of the wp-config.php. If I'm entering example.com/wp-admin - it opens without problem. However, when I try example.com it redirects to test.example.com.

Can't figure out why it's happening.

  • If I understand your current scenario, you are no longer on two different servers? You only have Commented Aug 22, 2016 at 19:21
  • Right, I changed registrar and the old server is no more available.
    – maximus
    Commented Aug 22, 2016 at 19:23

2 Answers 2


There are a few variables that need to be changed in order for you to update to the new link on your WordPress site.

As mentioned by Mark, try the following steps using the Search Replace DB tool:

  1. Go and download Interconnect IT's Database Search & Replace Script here
  2. Unzip the file and drop the folder in your localhost where your WordPress is installed (the root) and rename the folder to replace (screenshot)
  3. Navigate to the new folder you created in your browser (ex: http://example.com/replace) and you will see the search/replace tool
  4. It should be pretty self-explanatory up to this point: enter your old URL in the search for… field and the new URL in the replace with… field

You can click the dry run button under actions to see what it will be replacing before you execute the script. Once you're done be sure to remove the /replace/ folder.


@maximus: It's not a good idea to run raw SQL queries on the database via phpmyadmin; direct queries will will break serialized data in the database, i.e. break widget data, theme options, etc. Use https://interconnectit.com/products/search-and-replace-for-wordpress-databases to change domains, move from https to https, etc. It's a proven tool and is the answer to many other similar questions here on WpDev.

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.