CORS is an industry standard for accessing web resources on different domains. It is a critical security concept implemented by the web browser to prevent Js or CSS code from making requests against a different origin.
In the following screenshot, we are doing Ajax call from https://entranceking.com to https://entranceking.com. Both are different domains, even though the difference is of Https:// and Http://.
To simplify it further, if the Request is not coming from Same Domain or Origin, ignore it. This prevents hacking and resources from stealing without the owner’s knowledge.
You will get following error when your request will be blocked “WordPress site origin has been blocked by CORS policy: no ‘access-control-allow-origin’ after migrating site to SSL (https) certificate”.
How to fix CORS Origin issue in WordPress?
We need to fix Mix content and ensure 301 redirects to HTTPS is set.This can be done quicky using a plugin. Install Really Simple SSL plugin and fix the following things needed to implement.
Ensure you do take backup Prior installing any Plugin if in case anything goes wrong you can rollback to last working state. Please keep your WP admin login credentials handy as it will force you to log out and re-login during the configuration process.
Once you have installed this plugin,
#1 Enable Mixed Content fixer.
#2 Enable WordPress 301 redirection to SSL
#3 Enable 301 .ht-access redirect
You do not have to worry or enable other settings in this plugin. Also, it’s okay to ignore Really Simple SSL Pro banner on your right. Once we are done with these settings & post configuring this plugin – you should see green ticks in the Configuration tab of this plugin.
Happy Blogging with WordPress. Do reach out to us if in case this didn’t work or you had another way to fix it up~! Glad to hear back from your end. Thanks