5 WordPress sites (that is all of them) on our server (Apache, Ubuntu) were infected by some malicious code injecting javascript. I have deleted all the wp databases that were full of the injections and reuploaded them back from a backup. Almost all is well now, but one of the WordPress sites from one domain now redirects automatically to another WordPress on a different domain, which shouldn't be happening. Both domains and WordPress installations are hosted on the same server and worked just fine before. The database seems to be ok, .htaccess seems to be unchanged, I certainly haven't changed any domain configuration files on the server, plus I checked them and they seem unchanged as well. I have no idea where the problem is. Could you, please, point me to a probable cause? I have very limited experience with sorting out this kind of troubles. Thank you.

2 Answers 2


Use a tool like phpMyAdmin to check your databases directly. Open the (your db prefix)_options table in the database for the problem site. Then check the row where option_name = siteurl and see if the option_value is correct. If not, correct it and you will be able to login to the wp-admin of that site. You may still need to correct other urls too; this is a good tool for changing urls.

  • Hi, thank you. This was the first thing I checked. Both "siteurl" and "home" have correct values. Commented Nov 29, 2020 at 19:46
  • Did you use the phpmyadmin search tool and check the entire database for any part of the url that the site is being directed to?
    – shanebp
    Commented Nov 29, 2020 at 20:05

I have found the answer. Phpmyhpadmin probably glitched during the db import and mashed several databases together. I have dumped the whole thing again and imported the databases one by one and everything works now. Thank you!

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.