This type of error common while cross sharing the resources/file with another domain or subdomain. Even calling resources from a non-WWW domain of the same site might cause this error. Here we will discuss the solution associated with WordPress CMS. Following is the general message shown in Inspect element console.
Font from origin 'http://example.com' has been blocked from loading by Cross-Origin Resource Sharing policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://www.example.com' is therefore not allowed access.
Solution on Cross-Origin Resource Sharing Policy Error
- Login to WordPress admin panel
- Settings > General
- Verify WordPress address & Site Address (URL)
- Especially existence of WWW as per your need
For an accurate functioning of WordPress site, you need to apply the same strategy for both URLs. One with-WWW and second with non-WWW will push you into a trap of errors. This solution is applicable for same domain/TLD based WordPress site.