I have setup a WordPress under a dev.example.com domain and then after developing changed the document root of the top level domain example.com to the WordPress installation.

Now some links are on dev. and when I login to admin, I get redirected to dev. as well. I changed all the links manually but the language switcher still remains on dev.

How do I solve this?


WordPress uses absolute links almost everywhere in its database. It means that if you want to change domain, you have to change all these links in DB.

The easiest way is to export DB to SQL, find and replace all occurrences of old URL with the new one. But... This can break your DB - some things are stored as serialized objects in DB and such simple change of strings will break these objects and make them impossible to unserialize.

Another way is to use tool like Interconnects Search Replace DB

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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