Facebook-f X-twitter
EncodeByte
Need Help!
  • How-To
    How-ToShow More
    How To Redirect Old Website To New Domain Without Losing SEO | 301 Domain Redirect
    By
    Franchbabu
    How to Fix the “Windows Cannot Be Installed to This Disk” Error
    By
    EncodeMore
    How to Check Your Laptop’s Battery Health: A Step-by-Step Guide
    By
    EncodeMore
    How to Become a Freelancer in 2025: A Comprehensive Guide.
    By
    EncodeMore
    How to Activate Windows Legally and For Free (100% Working)
    By
    EncodeMore
  • Web Development & Coding
    Web Development & CodingShow More
    Hide Any Plugin from the WordPress Dashboard
    By
    Franchbabu
    How to Become a Freelancer in 2025: A Comprehensive Guide.
    By
    EncodeMore
    🚀 10 Reasons Why Hostinger Is the Best Web Hosting Platform for Speed, Security & Affordability
    By
    Franchbabu
    How to Add “Made with ❤️” to Your WordPress Footer (No Plugin Needed)
    By
    EncodeMore
    WordPress Redirect After Login: How to Set It Up
    By
    EncodeMore
  • Code Snippets & Scripts
    Code Snippets & ScriptsShow More
    Hide Any Plugin from the WordPress Dashboard
    By
    Franchbabu
    How to Hide a Class in WordPress (Easy CSS & Admin Tips)
    By
    EncodeMore
  • Website Design & UX
    Website Design & UXShow More
    10 Web Design Mistakes That Are Killing Your User Experience (and How to Fix Them)
    By
    Franchbabu
  • Make Money Online
    Make Money OnlineShow More
    How to Become a Freelancer in 2025: A Comprehensive Guide.
    By
    EncodeMore
    Top In-Demand Freelancer Niches for 2026 – Fast Growth Ahead!
    By
    EncodeMore
    Website related skillsets that you shoud have
    By
    EncodeMore
    Top Sites Like Fiverr: The Best Fiverr Alternatives for Freelancers
    By
    Franchbabu
    Best Telegram Channels For Free Paid Courses
    By
    Franchbabu
  • 🤩 Trending:
  • How-To Guides
  • WordPress & Website Development
  • Web Development & Coding
  • Windows & Software Fixes
  • Tech Tips, Tools & Tutorials
  • Computer Tips & Tricks
Font ResizerAa
EncodeByteEncodeByte
Search
  • How-To
  • Web Development & Coding
  • Code Snippets & Scripts
  • Website Design & UX
  • Make Money Online
Follow US
Made by ThemeRuby using the Foxiz theme. Powered by WordPress
WordPress Tips & TricksTroubleshooting & Fixes

Publishing Failed: The Response Is Not a Valid JSON Response — Fix It Fast

Last updated: November 25, 2025 11:49 pm
By
Franchbabu
Share

If you’re trying to publish a post in WordPress and see:
“Publishing failed. The response is not a valid JSON response.”
this means something is blocking WordPress REST API. Here are the quickest ways to fix it.

Contents
  • 1. Refresh Your Permalinks
  • 2. Fix Wrong Site URLs
  • 3. Disable Security Plugins Blocking REST API
  • 4. Cloudflare Block or Rocket Loader Issue
    • A. Firewall Blocking REST API
    • B. Disable Rocket Loader
  • 5. Fix Mixed Content (HTTP/HTTPS Conflict)
    • Quick Fix
  • 6. Plugin or Theme Conflict
    • Steps:
  • 7. Hosting ModSecurity Blocking Editor
  • 8. Incorrect .htaccess File

1. Refresh Your Permalinks

This solves the issue most of the time.

  1. Go to Settings → Permalinks
  2. Click Save Changes (don’t edit anything)

WordPress rebuilds .htaccess and fixes the broken routes.


2. Fix Wrong Site URLs

If your Site URL and WordPress URL don’t match, WordPress returns invalid JSON.

Go to:
Settings → General

Make sure both are identical:

https://yourdomain.com

No “www.” mismatch, no http/https mismatch.


3. Disable Security Plugins Blocking REST API

Security plugins often block REST requests.

Temporarily disable:

  • WordFence
  • WP Cerber
  • iThemes Security
  • Hide My WP
  • Limit Login Attempts

Try publishing again. If it works, reactivate plugins one by one to find the culprit.


4. Cloudflare Block or Rocket Loader Issue

If your site uses Cloudflare, two things can break JSON response.

A. Firewall Blocking REST API

Go to: Cloudflare → Security → Events
If REST URLs are blocked → allow them.

B. Disable Rocket Loader

Go to: Speed → Optimization
Turn Rocket Loader → OFF


5. Fix Mixed Content (HTTP/HTTPS Conflict)

If some assets load over HTTP and some over HTTPS, JSON breaks.

Quick Fix

Install Really Simple SSL and let it fix everything automatically.


6. Plugin or Theme Conflict

Something might be breaking REST routes.

Steps:

  1. Disable all plugins
  2. Try publishing
  3. If it works → reactivate plugins one by one
  4. If not → switch to a default theme (Twenty Twenty-Four) and test

7. Hosting ModSecurity Blocking Editor

Some hosting providers have strict ModSecurity rules.

Ask your hosting support:
“Please whitelist ModSecurity rules blocking WordPress REST API for my domain.”

Or turn off ModSecurity from cPanel if allowed.


8. Incorrect .htaccess File

A corrupted or altered .htaccess can cause this.

Default WordPress .htaccess:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress

Replace your existing one if needed.


Share This Article
Facebook Whatsapp Whatsapp LinkedIn
Leave a Comment

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Popular Categories

Themes & Customization

1 Article

Troubleshooting & Fixes

2 Articles

WordPress Tips & Tricks

8 Articles

WordPress Tutorials

5 Articles

Must Read

Web Development & CodingWordPress & Website Development

Essential Things To Do After Installing WordPress – Must Read!

How-To GuidesWordPress & Website Development

How to Get Google Adsense Approval Quick & Easy: Ultimate Guide 2023

Code Snippets & ScriptsWordPress Tips & Tricks

Hide Any Plugin from the WordPress Dashboard

Computer Tips & TricksHow-To Guides

How to Repair a Bad Hard Disk (Hard Disk Low Level Format)

  • I need help with …

Starting a Blog

WordPress SEO

WordPress Performance

WordPress Errors

WordPress Security

Got A Question?

Need Expert Help?
Let CodeXcool power up your website with
custom WordPress design, speed optimization, and SEO!
🚀 Get Started

You Might also Like

How-To GuidesWordPress Tips & Tricks

How To disable file editing in WordPress admin

Website Design & UXWordPress Tips & Tricks

10 Web Design Mistakes That Are Killing Your User Experience (and How to Fix Them)

15 Best WordPress Tips For Beginners
WordPress Tips & TricksWordPress Tutorials

WordPress Beginner Tutorial | 15 Best Tricks in 2025

How-To GuidesTroubleshooting & FixesWordPress Tips & TricksWordPress Tutorials

How do I unblock my WordPress login page?

EncodeByte

© 2025 EncodeByte – Discover expert tech tutorials, coding guides, troubleshooting solutions, and free tools. Simplify technology, build smarter, and learn faster with us.

About Us / Privacy Policy / Contact Us

Latest News

  • Coming Soon
  • Coming Soon
  • Coming Soon
  • Coming Soon

Services

  • Coming Soon
  • Coming Soon
  • Coming Soon
  • Coming Soon

Looking for custom web development or maintenance?

Check out our parent team at [CodeXcool.com] 🚀
— Let's build together!
Request a Quote
Welcome Back!

Sign in to your account

Username or Email Address
Password

Lost your password?