Plugins Plugin hub Backup SEO Caching Security Forms WooCommerce Images Best backup plugins
Hosting Hosting directory Shared Managed Cloud India
Themes & builders Compare Rank Math vs Yoast
Tools All tools Hosting finder Plugin stack builder Cost calculator Salt generator Theme detector Who is hosting this? Speed test Headline analyzer robots.txt generator Redirect generator Uptime calculator Blog name generator
Best lists Best backup plugins Deals
Guides All guides Speed up WordPress Choose hosting Back up WordPress
How we test

Troubleshooting · Troubleshooting

How to Fix "Publishing Failed" in the Block Editor in WordPress

Short answer

Publishing Failed means the block editor sent your post to the WordPress REST API and did not get a clean JSON reply back. The post on your screen is not saved yet, so copy your work first, then find why the save request failed. Check the REST API at /wp-json/, your permalinks, plugins, firewall rules and your login, in that order.

Key takeaways

  • Publishing Failed means the block editor save request did not return clean JSON from the WordPress REST API.
  • Copy all blocks before you reload, because unsaved changes live only in that browser tab.
  • A working /wp-json/ address that returns JSON points away from permalinks and toward plugins, firewalls or login problems.
  • Site Health tests the REST API at wp/v2/types/post with a 10-second timeout, as of November 2026.
  • A Contributor cannot publish posts by default, so a role problem can look like a broken editor.
  • A 403 reply means the server understood the request and refused it, so repeating the same publish will fail again.

What does “Publishing Failed” mean in the block editor?

“Publishing Failed” means the block editor sent your post to the WordPress REST API and did not get a clean JSON reply back.

The block editor does not save by reloading the admin page. It sends your post to an address under /wp-json/ and waits for a JSON reply that confirms the save. The REST API handbook says that with pretty permalinks enabled, the API lives at /wp-json/.

The message is a symptom, not a diagnosis. A firewall block page, a 404 page, a login page, a redirect or a PHP notice printed before the JSON can all trigger it. Your saved posts are safe, but the changes on your screen are not saved yet.

WordPress.org support threads list the same range of causes: a plugin conflict, an overloaded server, a wrong address in General Settings, permalinks that need resetting, and a REST API problem shown in Site Health. The support thread gives that list as the first place to look.

How do you save your unsaved work before you reload?

Copy all blocks first, because reloading the editor can lose the unsaved changes on your screen.

  1. Click the three dots in the top-right corner of the editor toolbar.
  2. Choose “Copy all blocks” from the menu.
  3. Paste the copied blocks into a plain text file on your computer.
  4. Keep that file open until the post publishes and you see it on the live site.

Do not close the tab or click Publish again until you have that copy. A second failed publish does not save the first attempt, and the editor may replace your draft with an older autosave when it reloads.

If the post is long, paste the copy into a second place as well, such as a local document. That gives you a fallback if the first file is lost.

How do you check whether the REST API answers?

Open https://yoursite.com/wp-json/ in a new browser tab, with your own domain in place of yoursite.com.

A page of text that starts with { is JSON, so the API answers at that address. A 404 page, a login page, a firewall page or a blank page means the API does not answer cleanly there.

The REST API handbook also notes the fallback for sites without pretty permalinks: the route is added as the rest_route parameter, as in https://example.com/?rest_route=/wp/v2/posts/123.

Next, open Tools, then Site Health, then the Status tab. WordPress runs a REST API test there, and the Site Health test checks wp/v2/types/post with context=edit and a 10-second timeout, as of November 2026. A result of “The REST API is available” means the server reached its own API.

If Site Health says “The REST API encountered an error” or “an unexpected result”, expand that row and note the exact status code and URL it shows.

That code points to the layer below. A guide on fixing changes that do not show on the live site can help when the fault is cache rather than the API.

What does each status code in the Network panel tell you?

Open your browser developer tools, open the Network panel, then click Publish again and look at the failed request to /wp-json/.

The status code and the response body tell you which layer refused the save. A 200 reply with an error in the body is different from a 403, and a 404 points at routing rather than a firewall.

StatusWhat you seeLikely causeNext step
401Login prompt or unauthorized JSONExpired session or missing loginLog in again in a new tab, then retry
403Block page or forbidden JSONFirewall, security plugin or roleCheck the firewall log and your role
404Not found pageBroken permalinks or rewrite rulesRe-save permalinks and check .htaccess
500Server error pagePHP fatal error in a plugin or themeCheck the debug log
TimeoutNo reply after many secondsOverloaded server or slow loopbackCheck Site Health loopback and ask the host

MDN defines 403 Forbidden as a reply where the server understood the request but refused to process it, and repeating the same request will fail again. That is why clicking Publish 10 times does not help when the code is 403.

Click the failed request and read the Response tab. A firewall page, a login page or a PHP message at the top of the JSON tells you who answered instead of WordPress.

Re-save your permalink structure, because that rebuilds the rewrite rules the REST API address depends on.

  1. Go to Settings, then Permalinks in wp-admin.
  2. Note the structure you use now, such as Post name.
  3. Click Save Changes without changing anything.
  4. Open https://yoursite.com/wp-json/ again and check for JSON.

The Learn WordPress lesson on permalinks says the default structure is Plain, with plain query strings, and any other choice needs clean URLs from the server. On Apache, that work is done in the .htaccess file.

If re-saving does not help, check that the WordPress block is present in .htaccess. The lesson shows the block starting with RewriteEngine On and ending with RewriteRule . /index.php [L], and it says the file needs the rewrite module enabled on Apache.

On Nginx there is no .htaccess file. The same lesson gives the Nginx rule as try_files $uri $uri/ /index.php?$args; inside the location block, and only your host can change that file. A related fix for posts that return 404 is covered in the guide to fixing 404 errors on posts.

How do you find a plugin or theme that breaks the save?

Deactivate plugins one at a time and retry the publish after each change, because a plugin that prints output during a REST request breaks the JSON reply.

Start with security, cache, optimisation and editor plugins, since those are the ones most likely to touch a save request. Keep a note of the order so you can turn the rest back on.

  1. Go to Plugins, then Installed Plugins.
  2. Deactivate the most recent plugin you added or updated.
  3. Try to publish again.
  4. If it still fails, reactivate that plugin and deactivate the next one.
  5. Repeat until the publish works, or until all plugins are off.

If publishing works with all plugins off, turn them back on one at a time and publish after each one. The plugin that brings the error back is the cause, so leave it off and check its settings or ask its author for a fix.

If plugins are not the cause, switch to a default theme such as Twenty Twenty-Five for one publish attempt. A theme that prints output or adds a broken block can break the same save, and the support thread above lists a theme conflict among the first causes to rule out.

How do you fix a security plugin or firewall block?

Look in the firewall log for the blocked /wp-json/ request, then allowlist that request instead of turning the whole firewall off.

A 403 in the Network panel is the main sign. Cloudflare's Error 403 page says a 403 without Cloudflare branding comes from the origin server, while a WAF rule can serve a 403 with Cloudflare branding when the request breaks a managed or custom rule.

For Wordfence, open Wordfence, then Tools, then Live Traffic, filter by Blocked by Firewall, and find the blocked request near the time of your failed publish.

Rank Math's Wordfence allowlist guide describes the same flow: use Learning Mode briefly to learn normal requests, or use the “Add param to firewall allowlist” button on the blocked entry, then return the firewall to Enabled and Protecting.

For Cloudflare, open Security, then Events in the Cloudflare dashboard and search for /wp-json/ at the time of the failure. The event names the rule that fired, so you can add a narrow exception for logged-in users on that path.

Do not disable the REST API to stop the error. The Site Health test exists because the block editor needs the API, and blocking it breaks saving, autosave and media work in the editor.

How do you fix a login, role or expired session problem?

Log out and log in again, then check your user role, because an expired session or a role without publish rights can stop a save.

The REST API uses cookie authentication plus a nonce for editor requests. The authentication handbook says that if no nonce is provided, the API sets the current user to 0 and treats the request as unauthenticated, even when you are logged in.

A nonce is a short-lived token, so a tab left open for many hours can fail while a fresh tab works. Log in again in a new tab, return to the editor tab, and click Publish again.

Check your role under Users, then Profile. WordPress.org's Roles and Capabilities page lists 6 roles, and it says a Contributor can write and manage their own posts but cannot publish them, while an Author can publish and manage their own posts.

If your role is Contributor, the Publish button is not meant to publish your post. Submit it for review instead, or ask an Editor or Administrator to change your role. If you were locked out during this check, see the guide to fixing a lockout from wp-admin.

How do you check the debug log for a PHP error?

Turn on logging to a file, reproduce the failure, then read the newest lines in wp-content/debug.log.

WordPress.org's debugging guide says WP_DEBUG_LOG logs errors to a debug.log file in your site's /wp-content directory when it is set to true in wp-config.php. Set WP_DEBUG to true and WP_DEBUG_DISPLAY to false at the same time, so errors go to the file and not to the screen.

  1. Back up wp-config.php first.
  2. Add define( 'WP_DEBUG', true ); above the line that loads wp-settings.php.
  3. Add define( 'WP_DEBUG_LOG', true ); and define( 'WP_DEBUG_DISPLAY', false );.
  4. Try to publish again, then open wp-content/debug.log.

Look for a fatal error or a notice with a timestamp that matches your publish attempt. The file name and line number in that entry point to the plugin or theme that printed output into the JSON reply.

Turn the logging off again after you find the cause. A debug log left on can grow large, and a 500 error from the same cause is covered in the guide to fixing the 500 internal server error.

How do you know the fix worked?

Publish the post, then open it on the live site in a private browser window and check that the newest text is there.

A green “Post published” notice in the editor is the first sign, but it is not enough on its own. Open the post URL, hard-refresh it, and compare the live text with the copy you saved at the start.

Then run these 3 checks:

  • Open Tools, then Site Health, and confirm “The REST API is available” is a passed test.
  • Open https://yoursite.com/wp-json/ and confirm it returns JSON that starts with {.
  • Edit one sentence, click Update, and confirm the change appears on the live site.

If all 3 pass, the save path is fixed. If the first publish works but later saves fail, check the loopback test in Site Health as well, since the guide to fixing a failed loopback request covers that related failure.

When should you contact your host?

Contact your host when the failure survives the plugin test, the permalink re-save and a fresh login, or when Site Health still fails after those steps.

Your host can see server logs, ModSecurity rules and firewall rules that WordPress cannot show you. Ask them to check for a blocked /wp-json/ request at the exact time of your failed publish, and to tell you the rule ID that fired.

Send them 4 facts: the exact time of the failure, the status code from the Network panel, the Site Health REST API result, and the URL of the post. That lets them search their logs without guessing.

If the host finds a server rule, ask them to allowlist /wp-json/ for logged-in users rather than turning the firewall off for the whole site. If they find no block and no server error, the fault is more likely in a plugin or theme, so return to the plugin test above.

What mistakes should you avoid?

Do not reload the editor before you copy your unsaved work, because the unsaved changes live only in that tab.

Do not disable the REST API, turn off the whole firewall, or switch the site to Plain permalinks as a permanent fix. Each of those hides the error while it breaks the editor, the site security or the site URLs.

Do not edit .htaccess or wp-config.php without a backup, and do not leave WP_DEBUG on after the fix. A wrong line in either file can take the whole site down, and a 403 from a rule you added yourself is covered in the guide to fixing the 403 forbidden error.

Frequently asked questions

Does Publishing Failed mean my post is lost?

No, posts you already published are safe, but the changes on your screen are not saved yet. Copy all blocks before you reload the editor, then paste them into a text file. If you reload first, the editor may show an older saved version and your newest edits can be lost.

Why does Publishing Failed happen only in the block editor?

The block editor saves through the WordPress REST API, so it needs a clean JSON reply from /wp-json/ to finish a save. The classic editor saves by reloading the admin page, so it does not use that same request. A blocked or broken REST API therefore breaks the block editor first.

Is it safe to switch to Plain permalinks to fix the error?

Plain permalinks can work as a short test, because they use the rest_route parameter instead of pretty URLs. Do not keep them as a permanent fix without a plan, because your post URLs will change. Re-save your chosen structure after you find the real cause.

Can a security plugin cause Publishing Failed?

Yes, a security plugin or a firewall can return a 403 for a /wp-json/ save request, and the editor then shows Publishing Failed. Check the plugin firewall log or the Cloudflare Security Events page for the blocked request, then allowlist that request instead of turning the whole firewall off.

What should I send my host when I ask for help?

Send the exact time of the failed publish, the status code from the browser Network panel, the Site Health REST API result, and the URL of the post. Those 4 facts let the host search server and firewall logs for the blocked /wp-json/ request and name the rule that fired.

Sources

  1. Routes and Endpoints - REST API Handbook WordPress Developer Resources
  2. WP_Site_Health::get_test_rest_availability() WordPress Developer Resources
  3. Permalinks, rewriting urls on Apache and Nginx Learn WordPress
  4. Updating failed. The response is not a valid JSON response. WordPress.org Support
  5. Error 403 Cloudflare Docs
  6. 403 Forbidden MDN Web Docs
  7. Roles and Capabilities WordPress.org Documentation
  8. How to Whitelist Rank Math in Wordfence Rank Math

Is your product missing, or something out of date?

Tell us what to add or correct. We read every note and reply when we need a source. A message does not buy a ranking.

About the editors

WPLegible editors

Researched from the primary sources listed above and checked against our editorial rules. About the site · How we test