CORS error using WP REST API
-
Hey there
I have set up a wordpress installation at a subdomain of my site. On the main domain, I am running a React build that fetches the content from the headless WordPress. It all appears to work.
However, on every load of the page I get a CORS error:
“No ‘Access-Control-Allow-Origin’ header is present on the requested resource.”
I mostly get this on just a single endpoint. It is not the same endpoint that throws an error, but there appears to be at least one CORS error every time.
Under settings I have set wordpress address and site address to the subdomain. And I am running https.
I have also tried setting the site address to the main domain which gave the same CORS errors. (And in this process I accidentally made a mistake, so I couldn’t acces the dashboard, so now both addresses are hardcoded in the function.php as the subdomain. If the site address is the main domain, I cannot access the controlpanel..)
Any idea of what the issue could be? Any help appreciated 🙂
The page I need help with: [log in to see the link]
The topic ‘CORS error using WP REST API’ is closed to new replies.