During Site Kit’s verification or connection steps, WordPress must return clean JSON from your REST API. If a security rule, redirect, cache, or server config injects HTML or blocks the endpoint, Site Kit throws “The response is not a valid JSON response.” Follow this checklist to diagnose and fix it fast.
When I try to verify/connect Site Kit by Google I get “The response is not a valid JSON response.” How do I fix this and finish setup?
/wp-json/ on your site (e.g., https://example.com/wp-json/). You should see a JSON object, not an HTML page or 403/404..htaccess rules).https://, no mixed http/https.Site Kit relies on the WordPress REST API. If that endpoint is blocked or altered, WordPress returns HTML (login page, WAF notice, 301 redirect) instead of JSON, triggering the error. Common causes are WAF/security plugin rules, cached/HTML responses from a CDN, broken .htaccess/permalinks, or mixed-content redirects from http → https.
Open:
https://example.com/wp-json/https://example.com/?rest_route=/CLI check:
curl -I https://example.com/wp-json/ # Expect 200 and content-type: application/json
curl -s https://example.com/wp-json/ | head -n 5
If you see an HTML page, a 301 redirect to login, or a 403, something is intercepting the request.
Go to Tools → Site Health → Status. Resolve any REST API or Loopback critical issues. These often pinpoint a blocking plugin, theme function, or server rule.
Temporarily deactivate security plugins and test Site Kit again. If it works, re-enable and add allow-rules for the REST API.
^/wp-json/ and ^/\?rest_route=Ensure your CDN does not cache or minify JSON. Create a page rule to bypass cache for /wp-json/* and then purge everything. Disable any HTML/JS optimization that might rewrite responses.
In Settings → General, set both URLs to the same https:// origin. Remove stray redirects (e.g., http://www → https:// without preserving path) that could cause the REST request to return HTML instead of JSON.
Click Save on the Permalinks screen to regenerate rules. If needed, restore the default WordPress block:
# 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
Make sure requests fall through to index.php so REST routes resolve:
location / {
try_files $uri $uri/ /index.php?$args;
}
/wp-json/* and temporarily relax rules while connecting.Accept: application/json and not strip auth cookies/headers for admin requests./wp-json/*)./wp-json/ after changes.Re-enable WP debug logging, reproduce the error, and inspect wp-content/debug.log. Share REST/HTTP status codes with your host so they can quickly identify a blocking rule.
WP Assistant is a free tool created by Atiba Software, a WordPress design and development company located in Nashville, TN. If you need more personalized WordPress assistance let us know, and we’ll get back to you ASAP!