Access to script at 'https://embed.tawk.to/xxxxxx' from origin 'yyyyyyyy' has been blocked by CORS policy

I’m using tawk wordpess plugin, all wors fine, but still have this issue when i analyse my website by [
PageSpeed Insights. i get this error msg “Access to script at ‘https://embed.tawk.to/xxxxxx’ from origin ‘yyyyyyyy’ has been blocked by CORS policy”
What can i do ? any help

CORS (Cross-Origin Resource Sharing) is a security mechanism that restricts web pages from making requests to a different domain than the one that served the page.
In this case, your WordPress site (yyyyyyyy) is trying to load tawk.to’s script (https://embed.tawk.to/xxxxxx), but tawk.to hasn’t explicitly allowed your site’s domain to access its resources.

Possible Solutions (Since Modifying tawk.to’s Server is Unlikely)

Ignore the Warning (if functionality is fine):
If the tawk.to chat widget is working correctly on your live website, you can often safely ignore this warning in PageSpeed Insights. It’s primarily an optimization issue, not a functionality blocker.

now If you’d want to optimize your website performance on Page Speed and reduce the impact of CORS errors, consider the following strategies:

Minimize Resource Requests:

Combine and Minify CSS and JavaScript: Combine multiple CSS and JavaScript files into fewer files and minify them to reduce their size. This can significantly improve load times.

Optimize Images: Compress images without compromising quality. Use tools like TinyPNG or ImageOptim to reduce file sizes. Consider using WebP format if your server and browser support it for even greater compression.
Leverage Browser Caching: Set appropriate cache headers for static resources (CSS, JavaScript, images) to allow browsers to store them locally and avoid re-fetching them on subsequent visits.

hope it helps

2 Likes