Unable to access WordPress Backend / Admin login (on "localhost")

What issue or error are you experiencing?

Hi, all worked fine until I set the site host to “localhost” today.
(I wanted to try that out because I can’t copy and paste inside Firefox, perhaps due to SSL issues).

After changing the site host, I can access the frontend with no problems.
But regardless of whether I choose nginx or Apache as server, I can no longer access the WP login page.

If I choose nginx the message is:

400 Bad Request

Request Header Or Cookie Too Large


If I choose Apache the error is:

Bad Request

Your browser sent a request that this server could not understand.
Size of a request header field exceeds server limit.

I’ve also execute this command which I found in a similar thread:

lsof -nP -iTCP -sTCP:LISTEN

Still the same problems.

What steps can be taken to replicate the issue? Feel free to include screenshots, videos, etc

Change the site host in the settings to “localhost”

Try out “nginx” and “Apache” as server.
Try out to login in the WP backend.

System Details

  • Local Version: Version 8.2.1+6583

  • Operating System (OS) and OS version: macOS Ventura

Local Logs

Attach your Local Logs here (Help Doc - Retrieving Local’s Log)

If have stripped down the error.log file to the relevant infos for download:
error.log.zip (1.0 KB)

I don’t know if I can post the local-lightning-verboseX.log here without revealing sensitive data.

I remember having this error once before and changing the router mode to “Site Domain” fixed it.
However, the “localhost” mode also worked before and I would like to maybe switch again, as some plugins require a license if you don’t use “localhost”.

Thanks for any help!

Hi @Jugibur

It seems like some kind of browser issue at play here. If you check in a different browser is it the same? What about after clearing your cache and cookies?

If you create a new, blank site in Local can you access that okay? If you can, then you may want to try reimporting the site getting the errors. The steps would look like this:

  • Locate the site files on your machine, and save a copy of them to your desktop. If you click Go to Site Folder under your site name it should take you right to where they are located.
  • Once you have those copied, completely delete the site from Local
  • Restart Local/your machine
  • Reimport the site back into Local. You can refer here on how to Restore from only Local site files
1 Like

Thank you so much, Nick-B! Deleting all Cache and Cookies solves the problem instantly!

1 Like

I’m glad to hear it!

I’ll close this out for now but if you have any other questions or concerns don’t hesitate to reach back out. We are always happy to help!

This topic was automatically closed 36 hours after the last reply. New replies are no longer allowed.