Skip Navigation

This thread is resolved. Here is a description of the problem and solution.

Problem:
The client is experiencing a CORS policy error when accessing fonts from a different domain, which is causing issues with content mixing between translated and default language versions on their website.
Solution:
We recommend first disabling any caching on your site to see if this resolves the issue. If the problem persists, you should add the following code to your .htaccess file to adjust the CORS settings:

#BEGIN WPML CORS Policy fix<br /><ifmodule mod_headers.c><br />    Header set Access-Control-Allow-Origin "*"<br />    Header set Access-Control-Allow-Methods "GET, POST, OPTIONS"<br />    Header set Access-Control-Allow-Headers "Content-Type, Authorization, X-Requested-With"<br /></ifmodule><br />#END WPML CORS Policy fix

Additionally, consult with your hosting provider to ensure proper server configuration for CORS. You might find these resources helpful:

If issues with mixed content still occur after these adjustments, please revisit this support ticket for further assistance.

Please note that the solution provided might be outdated or not applicable to your specific case. We highly recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If the problem persists, do not hesitate to open a new support ticket here.

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

Tagged: 

This topic contains 3 replies, has 0 voices.

Last updated by Dražen 3 weeks, 6 days ago.

Assisted by: Dražen.

Author Posts
April 16, 2025 at 6:47 am #16936934

bikbulatovaE

Completing this topic with a related issue:

Access to font at 'hidden link' from origin 'hidden link' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

So the translated versions try to access the .fr website version instead of the .com version. Right now this correspond to the language mixed with the main domain .com

Yes I can create staging

April 16, 2025 at 6:50 am #16936943

Dražen
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+02:00)

Hello,

The message means that your server is not configured correctly for CORS. This could be a setting in your server or any caching-related. You may find useful these two links to do so:

- hidden link
- hidden link

We advise you to show the error message to your hosting support adn ask to disable CORS policy or adjust it. Before that, please disable any caching and check, then contact them.

The same issue happened to some users and all of them were related to hosting or caching.
ex:

1. https://wpml.org/forums/topic/problem-with-multiple-domains/
2. https://wpml.org/forums/topic/cors-policy-preventing-copying-content/

Regards,
Drazen

April 16, 2025 at 7:05 am #16936962

bikbulatovaE

Adding this in HTA access can solve the issue:
#BEGIN WPML CORS Policy fix
<IfModule mod_headers.c>
Header set Access-Control-Allow-Origin "*"
Header set Access-Control-Allow-Methods "GET, POST, OPTIONS"
Header set Access-Control-Allow-Headers "Content-Type, Authorization, X-Requested-With"
</IfModule>
#END WPML CORS Policy fix

Your links are 404 errors.
Anyway, this symptom, in my case, is related to a bug that mix content from translated languages with the default language. It leads to mixed content on strings on the default language, and also CORS Policy issue on translated versions.

April 16, 2025 at 7:09 am #16936981

Dražen
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+02:00)

Hello,

Thanks for sharing.

Once we solve the mixed string issue, if you still have issue you can come back to this ticket and we can discuss it further.

Regards,
Drazen