Skip to content
Errors & crashes

Fix the WordPress Block Editor Not Loading

Fix a blank or broken WordPress block editor by reading the browser console, checking the REST API, and enabling WP_DEBUG to find the plugin that broke it.

Published Updated

Most of the time, a WordPress block editor that won’t load is a JavaScript error from a plugin or theme. Open your browser’s developer console (F12, or Cmd+Option+I on Mac), reload the edit screen, and read the red error. It usually names the file that threw, and that tells you which plugin to disable. Reinstalling WordPress, raising the PHP memory limit and switching to the Classic Editor don’t find that file, so leave them until you’ve read the console.

TL;DR: Open DevTools (F12) and reload the edit screen. A red console error naming a plugin’s script means a JavaScript crash, so disable that plugin. “Updating failed. The response is not a valid JSON response” means the REST API response is broken, so check /wp-json/ directly. If neither points to a cause, bisect plugins and theme, then turn on WP_DEBUG_LOG and read debug.log.

SymptomLikely causeFix it with
”The editor has encountered an unexpected error.”A plugin or theme script threw while the editor was drawingStep 1, read the console
The edit screen stays a blank paneA script the editor needs didn’t load, or failed before the editor startedStep 1, read the console
”Updating failed. The response is not a valid JSON response” on saveA PHP notice, warning or fatal, or a security or redirect plugin, broke the /wp-json/ responseStep 3, check the REST API
/wp-json/ shows a 404 pageThe rewrite rules don’t reach the REST APIStep 3, then the permalink fix
The editor only opens as raw block markup in the code editor”Disable the visual editor when writing” is ticked in your profileStep 4, check your profile
Works in a private window but not your normal browserA browser extension or stale cacheStep 2, rule out the browser
Broken only after installing or updating one plugin or themeThat plugin or theme loads broken JavaScript or throws PHP before the REST responseSteps 5 and 6, bisect plugins and theme
Console is clean, REST API returns valid JSON, bisect found nothingA fatal that only shows up in the logStep 7, turn on the log

Why the editor breaks the way it does

The block editor (Gutenberg) is a React application that runs inside wp-admin/post.php and post-new.php. WordPress loads a stack of script packages (wp-blocks, wp-element, wp-editor, wp-edit-post and more, documented in the Block Editor Handbook), then starts the editor inside wp.domReady(). Plugins add their own editor scripts on top, mostly through the enqueue_block_editor_assets action (see our WordPress hooks reference for when it fires).

A script error shows up in one of two ways. In WordPress 7.1.4 the editor has an error boundary: if a plugin’s block, panel or sidebar throws while the editor draws it, the editor is replaced by “The editor has encountered an unexpected error.” with a Copy error button and, where the editor can still read your post, a Copy contents button. That is read from the 7.1.4 editor script, not run. If instead a script that the editor depends on fails to load, or throws before the editor starts, there is nothing to catch the error and the pane stays blank.

The console tells you which file is at fault. WordPress joins only its own core scripts, the ones under /wp-admin/js/ and /wp-includes/js/, into combined load-scripts.php requests, and only on admin and login screens. Plugin and theme scripts always load as separate files, so a console error that names a plugin’s file is pointing at the right place.

A PHP fatal is a different failure. Across the whole site it gives the white screen of death or “There has been a critical error on this website”, and those guides have the fix. If the rest of wp-admin works and only the editor fails, stay here.

The second failure mode looks different: the editor loads, but saving throws “Updating failed. The response is not a valid JSON response.” That is not a JavaScript problem. The editor talks to the REST API (see the REST API Handbook) at /wp-json/wp/v2/, and it expects clean JSON back. If a plugin or your theme’s functions.php prints a PHP notice, warning or fatal before the JSON, or a security plugin blocks the REST route, or a redirect plugin rewrites the URL, the editor can’t parse the answer. Uploads from inside the editor go through the same REST API (/wp-json/wp/v2/media), which is why an image upload can fail while typing and saving text works. If that is your symptom, see the WordPress HTTP error on image upload.

WordPress block editor with a red notice at the top: Updating failed. The response is not a valid JSON response.
The notice from our test site (2026-11-01, WordPress 7.1.4, PHP 8.3.33, WordPress Playground). A must-use test plugin printed one line of HTML at the start of every REST API request. The editor still opened, and saving the post showed this notice.

How to fix it, fastest first

1. Read the console

Reproduce the failure with DevTools open. An error like Uncaught TypeError ... some-plugin/build/index.js points straight at the plugin. If the editor shows “The editor has encountered an unexpected error.”, press Copy contents first if it’s there, so your text is safe, then Copy error to get the stack trace for the plugin’s developer. This one step solves most cases and saves you from blind bisecting.

2. Rule out the browser

Hard-refresh (Cmd/Ctrl+Shift+R), then try a private window with extensions off. Ad blockers and privacy extensions sometimes block admin scripts. If it works in the private window, the problem is a browser extension or stale cache, not your site.

3. Check the REST API directly

Do this if you saw the “not a valid JSON response” message. Visit https://yoursite.com/wp-json/ in a browser. You should get a wall of JSON.

  • HTML, a 500, or a login redirect: a plugin or the theme is breaking the REST response. Bisect them (steps 5 and 6) and read the log (step 7).
  • A 404 page: WordPress serves /wp-json/ through its rewrite rules. Try https://yoursite.com/?rest_route=/, which skips them. If that returns JSON, the REST API works and the rewrite rules don’t reach it, the same server problem that makes posts return 404 while the homepage works.

Tools → Site Health runs the same check for you. On a healthy site it lists “The REST API is available” under passed tests. When it fails it says “The REST API encountered an error” or “…an unexpected result”, along with the endpoint and the response it got.

4. Check your profile setting

Open Users → Profile and look under Personal Options for a Visual Editor row. WordPress 7.1.4 only shows that row when “Disable the visual editor when writing” is already ticked, so if the row isn’t there, this isn’t your cause. When it is ticked, WordPress tells the block editor that rich editing is off, and the editor then opens only in its code editor, with no way back to the visual view. That is read from the 7.1.4 source, not run. Untick it and save.

5. Bisect your plugins

Deactivate all of them, confirm the editor loads, then reactivate one at a time until it breaks again. If you’re locked out of wp-admin entirely, rename the folder over SFTP:

mv wp-content/plugins wp-content/plugins_off

No plugin can load while the folder is renamed. Open the Plugins screen once so WordPress records them as deactivated, then rename the folder back and reactivate them one by one. The critical error guide walks through why that order matters.

6. Test the theme

Switch to a bundled default theme such as Twenty Twenty-Five, the default in WordPress 7.1. A theme that loads broken editor scripts or throws PHP in functions.php produces the same symptoms. While you’re in wp-admin, check Dashboard → Updates too: a plugin written for a newer WordPress can call editor functions your version doesn’t have yet.

7. Turn on the log and read the real error

For the REST and JSON failures especially, turn on debugging in wp-config.php. Change the existing WP_DEBUG line to true (a second define for it does nothing, because PHP keeps the first value) and add the other two:

define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );

The WP_DEBUG code generator writes this block, and WordPress debug mode explains each constant. The fatal is then written to wp-content/debug.log with the exact file and line number. If you’re not sure where your host puts that file, see where the debug log actually lives. If the stack trace is dense (namespaced class names, require chains, a fatal buried under ten lines of trace), paste it into our WordPress error log decoder to see which plugin and line triggered it.

For JavaScript errors, one more line helps:

define( 'SCRIPT_DEBUG', true );

It makes WordPress load the readable, unminified versions of its own scripts, so a stack trace through core shows real function names, and it also turns off core’s script joining. CONCATENATE_SCRIPTS isn’t needed on top of it, because SCRIPT_DEBUG already does that part. Remove both debug lines when you’re done.

What not to do

Don’t install the Classic Editor plugin and call it fixed. It hides the block editor so you stop seeing the error. The broken JavaScript or broken REST response is still there, and it will bite you again in the site editor, in widgets, or the next time you update. Diagnose first, and fall back to Classic only if you’ve decided to stop using blocks.

Don’t raise the PHP memory limit on reflex. A blank editor is rarely memory exhaustion. Real exhaustion throws a specific fatal, “Allowed memory size of N bytes exhausted”, which you will see in debug.log. If that line is there, fixing the allowed memory size exhausted error covers which limit to raise. If it isn’t, more memory changes nothing.

Don’t reinstall WordPress core first. Unless an update stopped partway or someone edited core files, your copy of WordPress is the same as on every other site running that version. What is different on your site is its plugins, theme and browser, so look there first. Reinstalling core before you’ve read the console and the log replaces working files on a guess.

Don’t clear or disable your cache plugin blindly as step one. Optimization plugins that minify and combine JavaScript can break the editor, so it’s worth testing, but read the console first.

Still stuck?

If the console is clean, the REST API returns valid JSON, and a full plugin-and-theme bisect still leaves the editor dead, the answer is almost always in debug.log. Turn on WP_DEBUG_LOG, reproduce the failure once, and run the fatal through the error log decoder. The stack trace names the file, so start there.

If the whole site is down rather than just the editor, the message on screen tells you which guide you need: a blank page is the white screen of death, “There has been a critical error” is the critical error fix, and “Error establishing a database connection” is a database connection failure.

Sources

William Lopez

William Lopez is the founder of Odie Themes. He builds the free WordPress tools and themes on this site and has been on WordPress.org since December 2019.

WordPress.org About

FAQ

Questions

Why is my WordPress block editor showing a blank white screen?

Usually a JavaScript error from a plugin or theme. If a script throws while the editor is drawing, the editor replaces itself with "The editor has encountered an unexpected error." If a script it depends on never loads or fails before the editor starts, the pane stays blank. Open your browser's developer console (F12, or Cmd+Option+I on Mac), reload the edit screen, and read the red error. It usually names the file that threw.

How do I fix "Updating failed. The response is not a valid JSON response"?

That is a REST API problem, not a JavaScript one. The editor expects clean JSON back from /wp-json/wp/v2/, so a PHP notice, warning or fatal from a plugin or your theme's functions.php breaks the response. Visit /wp-json/ directly. HTML, a 500 or a login redirect confirms the bug. A 404 there points at the rewrite rules instead: if /?rest_route=/ returns JSON, the REST API works and the pretty URL does not.

Does the Classic Editor plugin fix the block editor not working?

No. It only hides the block editor so you stop seeing the error. The broken JavaScript or broken REST response is still there, and it will come back in the site editor, in widgets, or the next time you update. Diagnose the real fault first.

Will increasing the PHP memory limit fix a blank WordPress editor?

Usually not. A blank editor is rarely memory exhaustion. Real exhaustion throws a specific fatal reading "Allowed memory size of N bytes exhausted", which you will see in debug.log. If that line is not there, more memory changes nothing.

How do I deactivate all WordPress plugins when I can't log in to wp-admin?

Rename the plugins folder over SFTP, for example wp-content/plugins to wp-content/plugins_off. No plugin can load from a folder WordPress can't find. Then open the Plugins screen once, so WordPress marks them all as deactivated, rename the folder back, and reactivate plugins one at a time until the failure returns.