How to fix the Visual Editor or Text Editor in WordPress when it’s not working

I had a weird phenomenon on a Multisite installation the other day. I can’t tell you with which update exactly it happened, as I only write a post on that site once every couple of months, but it must have been around the 4.7 or 4.8 upgrade. Here’s what was happening:

I could log into the site fine, I could display all posts in the backend fine, but editing them, or creating a new post (or page) resulted in an unresponsive editor window. Neither the Visual Editor nor the standard Text Editor wanted to accept any keyboard input. Moreover, none of the buttons could be pressed, including the Publish button.

The rest of the admin interface looked and behaved completely normal. I could even write posts from the iOS app, so fundamentally the installation wasn’t broken, just the editor part of it. Made no sense to me at all.

Things I’ve tried

I tried the usual tricks for getting rid of such a spurious affair:

  • re-install WordPress manually
  • disable all plugins
  • use a different default theme (in fact, I’ve tried several)
  • try logging in as a different user
  • since this was multisite, try writing a post on another site (same issues there)
  • since this was an installation managed from Plesk via the WP Toolkit, try more lax security settings

I probably tried other things, but none of it was making that editor working again. I didn’t understand what was going on.

The Solution

The solution came after extensive research, one part of which lead me to this thread in which Peter Luit explained a related problem that he could fix by defining a constant in the wp-confg.php file. I had never heard of it either:

Turns out that this constant is enabled by default and means that all JavaScript files are loaded with a single call, rather than multiple calls to multiple files. The idea is that, if your site is healthy, and every single JavaScript file is working fine, all of them together will execute and work fine too. However, should one in the middle not work so well, then the rest of them won’t be executing, and I guess that’s what happened on my installation.

By setting this constant to false, each JavaScript file is loaded individually, resulting in more http requests to the server (potentially making the overall load time slower), but every JavaScript file can be executed individually. If one isn’t working, none of the others are impacted. Hence, now my editor is working again, however I still have at least one JavaScript file that has an issue executing. Finding which one would be the next step.

So this constant isn’t a “fix” as such, it’s part of a debug strategy. But it’s great to have my site back up and running so I can continue to write posts.

Thanks for sharing, Peter!

Jay is the CEO and founder of WP Hosting, a boutique style managed WordPress hosting and support service. He has been working with Plesk since version 9 and is a qualified Parallels Automation Professional. In his spare time he likes to develop iOS apps and WordPress plugins, or draw on tablet devices. He blogs about his coding journey at http://wpguru.co.uk and http://pinkstone.co.uk.

9 thoughts on “How to fix the Visual Editor or Text Editor in WordPress when it’s not working

  1. Hi, I try everything but still not work. All do like you and i can not swich from text to visual when edit post. When i start new post i can swich and that it work but if i write one word in post i again can not change visual to text or text to visual

    1. The trouble is that there are literally a million reasons why the text or visual editor might stop working. The web is full of disappointed people trying to figure to why, and there are a great number of solutions out there. Most of the time, it turns out to be a plugin conflict or a conflict between the theme you’re using and a plugin. To make sure WordPress itself is working fine, start by switching off ALL plugins and switch to one of the recent default themes (like TwentySeventeen, TwentyThirteen, etc). Then see if the editor works. If it does, switch to your own theme. Try again. If all works well, switch on one plugin at a time and test after each plugin.

      If it’s not your theme or your plugins, try a re-install. Then a database repair. Finding those types of problems is really time consuming and extremely tricky. All I can wish you is good luck for your hunt to find the culprit!

  2. hey Thanks it realy helped man after 2 months i found this a big thanks.. But in my case it was: define(‘DISALLOW_FILE_EDIT’, false)

  3. Thank you, but didn’t work for me with define(‘CONCATENATE_SCRIPTS’, false); & then removed it.

    To solve this problem on my https://www.emotahar.com I just deactivated the BJ Lazy Load plugin & cleared the cache. Then I view the editor’s source page( right click & view page sourcr ). From here I only reloaded all .js files only from /wp-includes/.. Not from the plugin directory.
    It solves my problem. Then I reactivated the plugin & there was no problem. I think there was no problem with the plugin.

    Just reload all .js files.

    1. Good thinking about the plugin, both plugins and themes can cause the visual editor to behave strangely indeed. I’m glad you could sort it out, thanks for sharing your experience!

Add your voice!