The browser tries to parse a response as JSON but receives HTML. The first character of an HTML document is ‘<', which triggers the syntax error. This situation appears when an AJAX endpoint returns an error page, a login screen, or any markup instead of a JSON payload.
WordPress generates JSON through admin‑ajax.php, the REST API, and Gutenberg requests. Any PHP fatal error, warning, or stray output that appears before wp_send_json() corrupts the response. Authentication failures also redirect to wp‑login.php, producing HTML.
Server‑level redirects, ModSecurity blocks, or mis‑configured rewrite rules may serve static HTML files for the requested URL. Security plugins often intervene and replace the JSON with a 403 page.
When the response body starts with ‘<', JSON.parse throws the error and the JavaScript code stops. The UI freezes, blocks fail to load, and saving actions never complete.
Identifying the exact source of the HTML output is essential. The error does not indicate a problem with the JSON parser itself; it signals that the endpoint delivered the wrong content type.