Your site could not complete a loopback request

What issue or error are you experiencing?

I can’t seem to edit PHP theme files in an active theme in the Theme File Editor. Klicking “Update File” gives a "Something went wrong. Your change may not have been saved. Please try again. There is also a chance that you may need to manually fix and upload the file over FTP.

Editing a not active theme works. Editing non PHP files works. Read somewhere that this could be because of loopback requests not working. So ran Site Health and it says “Your site could not complete a loopback request”

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

Edit an active themes PHP files through Theme File Editor.


System Details

  • Local Version:*
    Version 9.0.5+6706

  • Operating System (OS) and OS version:
    Windows 10


Local Logs

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


Security Reminder
Local does a pretty good job of scrubbing private info from the logs and the errors it produces, however there’s always the possibility that something private can come through. Because these are public forums, always review the screenshots you are sharing to make sure there isn’t private info like passwords being displayed.

Hi @Boboz!

What server type (Apache/NGINX) are you on?

What PHP version?

Apache
8.3.8

If you change to NGINX are you able to make your theme edits?

Thank you for fast response!
No change with NGINX I’m afraid.

The error itself is kind of a generic WordPress error that can be a pain to diagnose sometimes. Looking through similar issues in the past it seems to come up more often on Apache so I was hoping switching to NGINX might resolve it.

One other simple thing you can try is if you are using any plugins on your site is disabling all of the plugins to rule out a culprit there.

You can do this quickly by opening Site Shell and running the command wp plugin deactivate --all

This is a bare bones WP (6.7.1) install just to test theme file editing. No plugins installed or active. No other sites active.

Also Router mode is localhost

Since you’re on Windows you could also check to make sure you don’t have any native security or firewall blockers on your device.

You could also check your browser’s developer tools to inspect network requests while replicating the error. Look for any failed requests and examine the details.

If none of the above fixes work immediately, you should still be able to manually update the PHP file via SFTP as a workaround.

Ok will read.
Native Windows security virus/firewall/etc is active yes.

1 Like

Thanks for the Troubleshoot Windows link. No change though.

The only not standard with this Local install is I changed the Sites path just a bit. Can i change it to standard (which is?) or something else and then change i back without losing my current sites?

Did you change it in your Preferences > New Site Defaults in the Local app? Your default pathing should be something like C > User > Local Sites > Site Name

As a precaution, you can always export your sites and save the copies to reimport should you run into any issues.

Ok thanks!

1 Like

Were you able to get things working here @Boboz?