-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Description
Description
When editing an existing post that contains a large number of server-rendered blocks, the block editor attempts to render all blocks at once by calling the /wp-json/wp/v2/block-renderer/ API for every block simultaneously.
On servers with limited resources, this results in partial failures. Some blocks load successfully, while many requests return 503 responses. As a result, the editor shows the error message:
Error loading block: The response is not a valid JSON response.
Once a block fails to load, it is not immediately editable. To recover, the user must manually force a re-render by switching the block to “Edit as HTML” and then back to visual editing.
This behavior appears to be caused by aggressive, non-chunked rendering of server-side blocks in the editor.
Expected behavior
Server-rendered blocks should not all be rendered simultaneously.
Blocks should be loaded lazily or in small batches.
A loading or skeleton state should be shown while blocks are being rendered.
Actual behavior
All server-rendered blocks are requested at once.
Low-resource servers return 503 errors for many block renderer requests.
Blocks remain in a broken state until manually refreshed.
Suggested improvement
Implement lazy loading or chunked loading for server-rendered blocks in the editor, with a proper loading state. This would reduce server load, prevent 503 errors, and improve editor reliability for large posts and constrained hosting environments.
Step-by-step reproduction instructions
- Set up a WordPress site on a low or moderate resource server
- Create a post and insert a large number of server-rendered blocks (blocks that uses
render_callback) - Save and publish the post.
- Reload or Navigate to the WordPress admin and open the post for editing in the block editor.
- Observe the network activity in the browser developer tools
The editor sends many simultaneous requests to
/wp-json/wp/v2/block-renderer/.
Notice that some of these requests return 503 errors due to server overload.
Screenshots, screen recording, code snippet
No response
Environment info
WordPress 6.9
Please confirm that you have searched existing issues in the repo.
- Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
- Yes
Please confirm which theme type you used for testing.
- Block
- Classic
- Hybrid (e.g. classic with theme.json)
- Not sure