Skip to main content
GrN.dk

Main navigation

  • Articles
  • Cases
  • Contact
  • Your Digital Project Manager
  • About Greg Nowak
  • Services
  • Portfolio
  • Container
    • Excel Freelancer
    • Kubuntu - tips and tricks
    • Linux Apache MySQL and PHP
    • News
    • Image Gallery
User account menu
  • Log in

Breadcrumb

  1. Home

Unable to Post in WordPress? Fix the Invalid JSON Response Without Guesswork

By Greg Nowak. Last updated 2026-07-06.

When WordPress refuses to save or publish and shows Updating failed. The response is not a valid JSON response., the block editor is usually only reporting what went wrong downstream. It expected a clean JSON response from WordPress and received something else: a 403 page, a redirect, a login screen, a PHP warning, a firewall challenge, or a broken REST API response.

For business owners, operations leads, and agency teams, the practical goal is not to collect random fixes. It is to restore publishing without weakening security, hiding a server problem, or leaving the site on a temporary workaround. Work from the least disruptive checks toward deeper server and plugin diagnosis.

What the error actually points to

The modern WordPress editor saves and updates content through REST API requests. On a normal site, the REST API index should be reachable at /wp-json/. If pretty permalinks are not available, WordPress can route the same kind of request through ?rest_route=/. If either route returns HTML, an access-denied page, raw warnings, or a redirect to the wrong host, WordPress cannot treat the response as JSON.

That is why installing Classic Editor can appear to help. It changes the editing workflow, but it does not prove the underlying site is healthy. Treat it as a short diagnostic, not as the final fix.

Check What you are looking for Best next move
Site Health REST API, loopback, PHP session, missing module, or debug warnings Fix the reported platform issue before touching plugins broadly
REST API URL Clean JSON at /wp-json/ or ?rest_route=/ If HTML or a 403 appears, inspect redirects, WAF rules, and server errors
Permalinks Rewrite rules out of sync after a migration, SSL change, or host move Save Settings > Permalinks once and retest
Network tab The failed editor request and its raw response Use the actual status code and response body to identify the blocking layer
Error logs Memory exhaustion, fatal errors, PHP notices, or plugin output Fix the specific error rather than masking it with broad deactivation
A safe triage order for invalid JSON response errors on a live WordPress site.

Start with checks that do not disturb the live site

Open Tools > Site Health first. Pay attention to REST API failures, loopback request failures, active PHP sessions, missing JSON-related modules, and debug logging warnings. These are often closer to the real issue than the editor screen itself.

Next, confirm Settings > General uses the correct domain and protocol for both the WordPress Address and Site Address. Mixed HTTP and HTTPS settings, old staging URLs, and proxy changes can all cause editor requests to land somewhere unexpected.

Then test the REST API directly:

curl -i https://example.com/wp-json/
curl -i 'https://example.com/?rest_route=/'

You want a successful response containing JSON. If you see a login page, a 301 chain to another domain, a hosting error, a bot-protection page, or PHP warnings before the JSON, the editor is not the root problem.

Be careful with plugin and firewall fixes

Disabling every plugin may be fast on a staging copy, but it is a risky first move on a revenue-generating site. If the issue appeared after a known update, start there. Test the most likely plugin, theme, snippet, page builder, security rule, or CDN change first, then retest publishing after each change.

If Wordfence or another security layer is involved, look for blocked background requests, strict firewall rules, and false positives around REST API endpoints. A short, controlled Learning Mode test or a specific allowlist entry for a verified safe request is usually better than leaving the firewall disabled. Also check host-level WAF rules and CDN bot protection. Any layer that returns HTML to an editor save request can trigger this exact message.

Only raise memory when logs support it

Memory can be the cause, especially with large pages, visual builders, heavy custom fields, or media-rich posts. But raising memory without evidence can hide a slow leak or plugin problem. Look for errors such as allowed memory size exhausted in the PHP log, WordPress debug log, or host dashboard.

If memory exhaustion is confirmed, add a WordPress memory limit in wp-config.php before the final stop-editing comment:

define( 'WP_MEMORY_LIMIT', '256M' );

Some hosts enforce memory at the PHP or account level, so this constant may not be enough. If the error continues, compare WordPress, PHP, and hosting limits rather than increasing numbers blindly.

Log the failure without exposing it to visitors

If the cause is still unclear, enable logging long enough to capture one failed save. Use staging when possible, and back up configuration before editing it.

define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );
@ini_set( 'display_errors', 0 );

Reproduce the publishing error once, then inspect wp-content/debug.log and the failed request in the browser Network tab. Turn debugging back off when finished. Leaving logs and warnings exposed on a live site is poor operational hygiene and can leak details attackers do not need.

When to bring in help

The hard cases usually sit between layers: WordPress looks fine, the host sees no outage, the security plugin says it is protecting the site, and the agency only sees that publishing is blocked. A focused review can trace the request from editor to REST API to server response and separate the real cause from the symptoms.

If you want a practical second pair of eyes, Greg can help trace the failure path, fix the immediate publishing issue, and leave the site with a cleaner operational setup instead of another fragile workaround.

Related on GrN.dk

  • WordPress Autoloaded Options Are Still a Paid Performance Fix, Not Just a Site Health Warning
  • AI Crawler Control for Business Websites: Protect Content Without Sacrificing Search Visibility
  • WordPress 6.8 Password Hashing: Why Legacy Login Bridges Become a Troubleshooting Risk

Need help with this kind of work?

Get help tracing the WordPress error Get in touch with Greg.

Sources

  • Routes and Endpoints – REST API Handbook
  • Site Health screen – WordPress.org Documentation
  • wp-config.php – Common APIs Handbook
  • Debugging in WordPress – Advanced Administration Handbook
  • Firewall Options – Wordfence
Last modified
2026-07-06

Tags

  • wordpress
  • wordpress troubleshooting
  • rest api
  • Website Operations

Review Greg on Google

Greg Nowak Google Reviews

 

Illustrated infographic summarizing: Shorter TLS certificates expose every renewal you never automated
Shorter TLS certificates expose every renewal you never automated
2026-07-26

Shorter TLS lifetimes leave less room for manual handoffs and faulty deploy hooks. Build a renewal path that protects service availability.

Illustrated infographic summarizing: One Timeout, Two Orders: Make AI Actions Safe to Retry
One Timeout, Two Orders: Make AI Actions Safe to Retry
2026-07-25

A timed-out AI action may already have succeeded. Stable keys, durable ledgers, queues and stored results prevent a routine retry from duplicating real work.

Illustrated infographic summarizing: Your AI Visibility Dashboard Needs a Methodology, Not More Charts
Your AI Visibility Dashboard Needs a Methodology, Not More Charts
2026-07-24

A practical framework for measuring AI-search visibility with fixed prompts, repeated tests, separate metrics, retained evidence, and honest reporting.

Illustrated infographic summarizing: AI Admin APIs Are Here—But Your Directory Is Still the Source of Truth
AI Admin APIs Are Here—But Your Directory Is Still the Source of Truth
2026-07-23

New AI admin APIs can automate access and spend controls, but reliable governance still starts with authoritative directory data and clear ownership.

Illustrated infographic summarizing: OpenAI Presence Arrived—But Is Your Workflow Ready for an Agent?
OpenAI Presence Arrived—But Is Your Workflow Ready for an Agent?
2026-07-22

Before an AI agent can take on real work, its workflow needs clear scope, permissions, handoffs, evaluation cases, and production monitoring.

Illustrated infographic summarizing: Chatbot Transcripts Quietly Became a Retention and Redaction Problem
Chatbot Transcripts Quietly Became a Retention and Redaction Problem
2026-07-21

Chatbot transcripts spread across providers, logs and support tools. Here is how to map each copy, redact sensitive data and test deletion properly.

Illustrated infographic summarizing: Cloudflare Service Keys Stop in September: Find Every Caller
Cloudflare Service Keys Stop in September: Find Every Caller
2026-07-20

Cloudflare Service Keys stop working on September 30, 2026. Here is how to find every caller, move to scoped API tokens and avoid a late outage.

Illustrated infographic summarizing: Your AI Workflow Needs an Acceptance Test Before It Meets Customers
Your AI Workflow Needs an Acceptance Test Before It Meets Customers
2026-07-19

A practical way to test AI workflows using realistic scenarios, tool checks, human rubrics, regression suites, and clear release gates.

Three cover candidates for The Goats Were Load-Bearing fanned on a dark background: an ember-lit door, three slow knocks, and a founders' ledger
The Goats Were Load-Bearing: a fantasy where the bill always comes due
2026-07-19

A teaser for the upcoming darkly comic fantasy novel The Goats Were Load-Bearing — a village, a door that must stay poor, and the worst possible time to sell the herd. Readers pick the cover.

Vegan Power game: the yellow player catches falling fruit while a chicken and a cow look on
Vegan Power: The Little Game About Eating Fruit, Not Friends
2026-07-19

Vegan Power is a free browser game where you catch fruit, dodge the animals, protect seven hearts, and chase a better high score.

More articles
RSS feed

GrN.dk web platforms, web optimization, data analysis, data handling and logistics.