Support » Fixing WordPress » Can’t edit main theme php files after upgrading to 4.9

  • I am unable to edit main theme (php) files using the build in WordPress editor after upgrading to version 4.9. I get the following error:

    Unable to communicate back with site to check for fatal errors, so the PHP change was reverted. You will need to upload your PHP file change by some other means, such as by using SFTP.

    I have cleared my browser cache, cleared my website cache, de-activated all plugins and reinstalled main theme.

    Furthermore; I am able to edit php files in other themes without issues. I have also checked my permissions and ownership of all files. Everything seems perfect.

    The page I need help with: [log in to see the link]

Viewing 15 replies - 91 through 105 (of 124 total)
  • I have the same problem, I manually downgrade to the WordPress 4.8.x.

    Sorry for the delay in responding, I have a day job to go to.

    On the website, I appear to have an issue with a plugin called “Pods – Custom Content Types and Fields”

    If I deactivate it and try to make a change to the category.php them file I get the following error:

    “Your PHP code changes were rolled back due to an error on line 4 of file wp-content/themes/genealogy/parts/social.php. Please fix and try saving again.

    Call to undefined function pods()”

    With only this plugin activated, I fall back to the error that is the topic of this thread. I have no knowledge about this plugin or the .php file mentioned, they were there when I took the site over. I have a feeling though this is an unrelated issue.

    Re: health check. Both values are set to off. This is the case for both my websites

    • This reply was modified 2 years, 2 months ago by genealogydotie. Reason: Added info that values are same for both sites I have

    One of the early questions I didn’t answer is how much time between clicking update and when the error being reported here is returned…? In all cases a good 2 or 3 minutes, which adds considerably to the pain of testing this, re plugins etc…

    I also set debug to true and added the code you gave early on in the appropriate place in file.php, but nothing came of it other than one deprecated usage in the theme, seemingly unrelated…

    I am also finding the issue in more circumstances, sort of in alignment with all the varied circumstances being reported here…

    Is there correlation between the health check plugin taking a good 2 or 3 minutes to run its course, and this issue…?

    It seems that this issue is being reported in a lot of other support topics besides this one…

    @clorith, and/or others…

    May I please ask, no disrespect intended regarding all the wonderful hard work and time of volunteers and folks who make WordPress all that it is… But for those of us not so familiar with or able to understand how all this works…?

    With all these soooo many different varying circumstances, with varied plugins and child themes and primary themes and no plugins and active and not active and etc etc…

    Why is it still seemingly in question that it is an issue with 4.9 and the way that the new editor features are being implemented…? Those changes are the one common factor in all of this, or so it seems…? So many varied and different things working before the update now seeming to be implicated, all apparently engaging with that one major change…?

    Could some up-to-date overview be given for what the current WP thinking is on this, or what is being explored…?

    Moderator Marius L. J.


    @genealogydotie If you can perform the save with PODS disabled, it sounds like that’s your incompatible plugin in this case.

    @backups We are pretty strict about soliciting off-site contact, please don’t do that 🙂

    @crzyhrse The reason why we’re still investigating and not sold on it being a WordPress core issue, is that we are unable to reproduce the issue on many different platforms with clean installs without any plugins and using a default theme, this makes us think it’s either a configuration issue, or a plugin/theme conflict (which is the most common issue after an update). We are actively working with hosts as well as you all having the problems trying to identify the root cause that some, but far from all, users are experiencing these issues.

    We do understand it is frustrating though, it’s just as frustrating for us when we can’t find the cause as it takes considerable effort from us to work through the troubleshooting steps, so please do bare with us 🙂


    Thanks i did try what you say and have the feeling anything works fine

    With the Pods plugin disabled I immediately get the error – it looks to me it could be a line of code looking for the plugin – and wp does not proceed any further – so can not verify if this plugin is the cause or not.

    @backups I am getting you into trouble😀 Thanks for the offer but I actually enjoy the challenge of finding out solutions myself.

    Moderator Marius L. J.


    @genealogydotie PODS is the problem, you are getting an expected result form WordPress that an error was found (since some code elsewhere seems to rely on pods), but the loopback completed as expected when you disabled PODS 🙂

    Thanks @clorith

    @clorith I have discovered that if you open and save any of your theme files in Notepad++ just once it “unlocks” the WP theme and plugin editors. No more errors when saving theme or plugin files.

    Originally I had to make a quick edit to my theme using Notepad++ which, unknown to me, actually solved my ‘Unable to communicate’ error – I had solved the problem by editing theme files in Notepad++ but assumed my last troubleshooting step was the reason the error went away which I shared on page 6 of this thread.

    My own solution didn’t work on my other three sites so I kept digging. On reading the comment from @don_alejandro at I tested three other sites (2 Apache and 1 localhost Wamp) that were getting the communicate error. Made a tiny edit using Notepad++ to one of the files in each theme on each site and the communication error has gone on all three.

    The error seems to apply to sites that are not under development and have not made recent template changes which may be why you were not able to replicate it in tests. Once a template change is made using something like Notepad++ the WP admin editor works.

    @debresser mentioned on page 6 of this thread that his error disappeared and he doesn’t know why. I suspect that he edited one of his theme files in a text editor and was subsequently able to use the WP editor.

    It would be great if someone else could try this and confirm that it works.

    @padraigbeirne does not work for me. editing by notepad++ does not help resolving the issue.

    @genealogydotie @clorith I was not trying to solicit for a job or whatever. I was just trying to be friendly and help him out for free and guide him through the process of editing. Anyway it wont happen again.

    Same here!
    Unable to edit the .php files within the Editor page area. It wants me to edit the files via FTP 🙁

    @backups Yes, I got that.

    Having the same error, tried editing with Notebook ++, the problem remains. I’m on 4.9, cloudfare hosting..

    Guys may be you made an option in WP Settings to disable this feature?

    You see many peoples have the same problem.

    • This reply was modified 2 years, 2 months ago by gopros.

    It took awhile to get here, I am using 152 plugins across a bunch of sites, well over a hundred from the WP depository, managed through ManageWP… I wanted to be definitive for myself on this, so installed all of them on one dev site…

    And I have cleared all of them from this issue, except one…

    When I deactivate WP-SpamShield the issue goes away immediately and completely… YAY, this issue is no more on any of my sites…

    ShortPixel was the other plugin that was causing the issue for me, and so grateful that they got on it and fixed it right away, once I let them know (see earlier in this thread)…

    So at least from this perspective it does not seem to be a WP core issue, like I once was believing…

    No knowing what is going to happen with WP-SpamShield, considering all the controversy that is currently and in recent weeks going on around it… So far in my exploring none even remotely better at what it does… And, so apropos, within minutes of deactivating WP-SpamShield on one site a bogus registration came in, and then before I got back to reactivating it, still testing, another…

    Need to look elsewhere I guess, maybe something has evolved in the meantime… Such a shame, it is such a great plugin… From this perspective there seems to be way to much ego involvement in the past, not enough coming to the present and realizing we are truly all of us in this world together, a world-wide community, and how incredibly, beautifully much WordPress is contributing to the furthering of that awareness…

    Will keep WP-SpamShield activated on a couple sites in the meantime, now I know I can just deactivate it if I need to mess with php files…

    I will get a message to WP-Spamshield’s author…

Viewing 15 replies - 91 through 105 (of 124 total)
  • The topic ‘Can’t edit main theme php files after upgrading to 4.9’ is closed to new replies.