Skip Navigation

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

Problem:
As soon as I scan the site on Google page speed insights I get the following error in Best Practice:

Properly defines charset Error!
A character encoding declaration is required. It can be done with a tag in the first 1024 bytes of the HTML or in the Content-Type HTTP response header. Learn more about declaring the character encoding.
Solution:

Relevant Documentation:

https://njengah.com/fix-character-encoding-problem-wordpress/
https://developer.chrome.com/docs/lighthouse/best-practices/charset/#html
Here is a guide to get your site to use UTF-8

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.

This topic contains 5 replies, has 4 voices.

Last updated by dvirH-2 1 year, 11 months ago.

Assisted by: Ilyes.

Author Posts
May 28, 2023 at 4:56 am #13726787

dvirH-2

Hey,

As soon as I scan the site on Google page speed insights I get the following error in Best Practice:

Properly defines charset Error!
A character encoding declaration is required. It can be done with a <meta> tag in the first 1024 bytes of the HTML or in the Content-Type HTTP response header. Learn more about declaring the character encoding.

This happened since I made the redirection based on the browser language.
Is it related? How to fix it?

Thanks,

May 29, 2023 at 7:54 am #13729417

George Botsev
WPML Supporter since 02/2014

Languages: English (English )

Timezone: Europe/Sofia (GMT+03:00)

Hello!
If you suspect the browser language redirect is the issue, you better test and disable it and see if this helps.
Personally, I doubt that that setting causes the problem.
I am not sure if you serve different content for your user and for Google, but I see that you have the declaration for charset already there, and this is one of the recommended ways according to the doc hidden link

May 29, 2023 at 8:24 am #13729695

Alejandro
WPML Supporter since 02/2018

Languages: English (English ) Spanish (Español ) Italian (Italiano )

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

The problem you are talking about seems to be this one: hidden link

It has nothing to do with WPML, since that option there wouldn't really be touched by WPML at all.

I can only suspect that the character encoding is not defined in your WP-config.php or maybe you can check this guide and see if it helps: hidden link

Regards.

May 29, 2023 at 6:42 pm #13734871

dvirH-2

Hi Alejandro,
Thank you for the help and clarification.

I checked my website and is set to UTF-8.
You may tell me what I am missing.
Also, when i checked to throw the lighthouse in the inspect its work, just not throw the browsers.

Thank you!

image.png
May 30, 2023 at 10:30 am #13738417

Ilyes
Supporter

Languages: English (English ) French (Français ) Arabic (العربية )

Timezone: Pacific/Easter (GMT-06:00)

Hello again,

I'm afraid this is outside our support scope, and I can't find anything that could link to WPML in relation to this Encoding issue,

I can see that the Encoding is indeed set to UTF-8 but if referring to this Lighthouse guide didn't help : hidden link

I highly recommend checking other forums or google team,

Thank you for understanding 🙂