WordPress wp-admin redirect problem

This post is about a wp-admin redirect problem that I encountered today. I’m writing about it as I found it difficult to source the solution (there appeared to be many). Here is the background:

I have 2 WordPress sites that were accessible to the public today. When I tried to go to the wp-admin page I was sent to an error 404 page on both sites. I had not updated any themes or plugins in the past few days and had never had this issue before.

Solutions that didn’t work:

  • I cleared my browser cache and cookies (and tried it in a different browser)
  • I removed my plugins
  • I removed my active theme
  • I deleted (and then restored) my .htaccess file
  • I replaced the wp-admin folder with the latest version (even though it was up to date)
  • I replaced the wp-includes folder with the latest version

None of the above worked, although they were reasonably touted as solutions. And I was getting on the right track. Here is what did work:

  • I made a copy of all my top level-files
  • Then I deleted all of those files e.g. wp-config-sample that were duplicated in the new installation
  • I uploaded the latest versions of each file

TA DAAAAA! It worked.

Wp-admin redirect problem resolved

I was able to log in again after. It was never possible to establish precisely what was causing the issue from the forums that I read. I was very happy to resolve it eventually. It is a long time since I had a difficulty with WordPress and it is reassuring to be able to solve it with just a little sweat.