Home / Questions / What does unexpected token in JSON mean in WordPress?
What does unexpected token in JSON mean in WordPress?
The unexpected token error means a script expected JSON but received an HTML page or a PHP error. The real cause is usually a warning printed before the data.
Plugins and the block editor expect a clean JSON reply from the server. If PHP prints a warning or a login page before that reply, the script stops with “Unexpected token < in JSON”.
Find the source
- Open the browser console and find the request that failed. Open its address in a new tab to see the raw reply.
- If the reply shows a PHP warning, turn on the debug log and fix the file it names.
- If the reply is a login or a firewall page, check your security plugin and the host firewall.
Deactivate one plugin at a time while you test. The plugin that changes the reply is the cause.
For a stubborn case, contact us and send the console error.
Ready to act on this?
Get a written review of your site, or send us your question and we will reply within 24 hours.
Related services
Related questions
Not sure where your site stands?
Send us the details and we will reply within 24 hours with a clear next step.