Summary
When an AI chatbot widget on WordPress stops replying with 403 Forbidden (rest_cookie_invalid_nonce), CORS policy: No 'Access-Control-Allow-Origin', or a spinner that never resolves, the cause is usually page-cache stale nonces, a REST API block from a security plugin, or an unproxied OpenAI/Anthropic call.
If you want this fixed without breaking your theme or cache, SazM repairs broken WordPress AI chatbot widgets for a fixed $99, delivered within 48 hours, 100% in writing with zero calls. See our AI integration services or request the $99 fix.
1. Stale wp_rest Nonce (403 rest_cookie_invalid_nonce)
Full-page caching (Cloudflare, WP Rocket, LiteSpeed Cache) serves yesterday's wp_rest nonce to today's visitors, causing 403 on /wp-json/...:
- For public visitor chat endpoints, use
permission_callback => '__return_true'paired with server-side rate limiting and Turnstile/honeypot checks instead of a cachedwp_restnonce.
2. CORS & Security Plugin Blocks
- Never call OpenAI or Anthropic directly from browser JavaScript (which exposes your API key and hits CORS). Proxy requests through a WordPress REST route or a Cloudflare Worker.
- Whitelist your chatbot REST namespace in Wordfence, Cloudflare WAF, or iThemes Security if it triggers
403onPOST.
Need It Fixed?
We combine 20+ years of WordPress/PHP production experience with production AI agent, Workers AI, and 5-tool MCP server (sazm.in/mcp) engineering—fixing broken WordPress AI widgets for a fixed $99 within 48 hours, verified before you pay and 100% async. Start your $99 fix or explore our AI integration services.