plugins – CORS Error when using TranslatePress and REST API
I’m using the TranslatePress plugin to provide translations for my website. The default version is served without language slugs:
example.com, and the translated versions are served through
example.com/en (or any other two-letter language name slugs).
When using WordPress REST API,
example.com/wp-json/... works fine, but
example.com/en/wp-json/... throws CORS error:
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://example.com/en/wp-json/... (Reason: CORS header ‘Access-Control-Allow-Origin’ missing)
what should I do?