This site uses cookies and other tracking technologies to make possible your usage of the website, assist with navigation and your ability to provide feedback, analyse your use of our products and services, assist with our promotional and marketing efforts, and provide better user experience.

By using the website, you agree to our Privacy policy

Accept and continue

Report a bug

Cancel
98
How-to 7 min read September 10, 2019

How to set the site encoding correctly

To ensure that information is displayed normally on the website pages, set the correct encoding. If the encoding is selected correctly, and instead of the desired content, the site displays ьХПНЙЮЪ all the same, errors will have to be fixed.

What is a site encoding

Encoding is a set of interconnected code symbols and their playback on the screen. In fact, this is a way of transmitting alphabetic characters, numbers, special characters in the form of bytes.

Now the two most popular encodings are used:

  • UTF-8;
  • Windows 1251.

Different encodings are sometimes used within the same resource. In this case, it occurs incorrect display of information. To avoid problems, it is advisable to choose a single standard; then the systems will not conflict with each other.
Incorrect encoding on site
A number of experts consider the UTF-8 option to be preferable. It is supported by all servers, platforms, the most popular search engines and browsers.

The second encoding was created to serve the crack of the Windows operating system. Therefore, her popularity is lower.

How to determine the site encoding

The site encoding can be found through the source code. To do this, you must:

  • open the desired web page;
  • press the CTRL + U key combination. This page will appear:
Google Chrome Page Source
  • then press the CTRL + F keys to open the search window at the top:
Page encoding in source code
  • enter the word "Charset" in the search and see what encoding is indicated next to it.
UTF-8 encoding in page code
In this case, UTF-8.

If after all the manipulations nothing was found, perhaps the encoding has not yet been set.

For verification, special services are used. One of them is Browserstack. You should create an account, and during the test period, check the website. You can also check through Validator, which determines the encoding from the HTTP headers and other data in the document.
Validator Page Code Validation
Log in to your Browserstack service account. Select the necessary devices and run the test:
Check site display on different devices Browserstack
After that, you will see how your website is displayed on various devices and operating systems.

How website encoding affects SEO

Standard site encodings may vary; it all depends on the website. Search engines recognize and index text anyway. However, it is important to check that when it is displayed, unreadable characters, hieroglyphs do not appear.

Errors occur if the encoding of the server does not match the encoding of the site. And even though the robot will be able to recognize the content in this case and display it correctly in the search results, the users will leave.

An incomprehensible character set does not carry any semantic load and does not cause trust. Visitors will not spend time and effort on self-tuning the encoding through the browser. Because not everyone knows how to do this, or simply does not consider it necessary to lose their time. Because of this, attendance and, accordingly, income will fall.

Therefore, the effect of encoding on SEO is indirect. It focuses on behavioral factors, viewing depth, and bounce rate.

How to solve the problem of incorrect encoding

There are several stages of solving the problem:

  • encoding in the meta tag;
  • document encoding;
  • encoding in .htaccess;
  • encoding in the MySQL database.

Encoding in the meta tag

The meta tag sets the desired encoding. To do this, when creating an HTML document, webmasters specify it in the head block. Example:
Encoding in head block
This fragment is not a ready-made code; therefore, before its implementation, it is necessary to consult with specialists.

Document encoding

Ready HTML text files must also be saved in the selected encoding. To do this, just use the text editor Notepad ++. Just open the document in it, go to the "Encodings" section, then "Convert to UTF-8 without PTO."
Convert document to UTF-8
If you are done with a PTO, empty characters will appear. They also fulfill their function, but in this case, they will not be superfluous characters.

Encoding in .htaccess

If strange characters still appear when opening web pages, change the server settings. To do this, open the .htaccess file in the root directory and write the line in it:
AddDefaultCharset UTF-8
If there is no file, you should create it. Save settings. There is no need to restart the server.

Encoding in the MySQL database

Since the resource is also based on databases, the encoding in tables and fields should be replaced. If unreadable characters do not disappear, eliminate the connection problem. To do this, connect to the database server as the MySQL root user.
mysql  -u root -p
Select the desired database:
USE name_database;
Run the query:
SET NAMES ‘utf8’;

Conclusion

On each site, you must specify the encoding. This will transform the content into a user-readable form. When choosing encodings, it is desirable to give preference to UTF-8. She is the most popular and most search engines, sites, browsers recognize her.

To find out if the encoding is displayed correctly on the content of a web resource, use the online tools:


You can also use ready-made tools that convert a character set into a readable look.

For SEO, the encoding is important so that the published content is displayed in its normal form. If users receive a set of characters instead of text on a web resource, they will stop visiting the site. As a result, behavioral factors worsen, and then the ranking falls.

Therefore, monitor the display of content, follow through metric systems for attendance, failures, and the depth of views, which may lead to the thought of an error with encoding.

This article is a part of Serpstat's Checklist tool
Checklist at Serpstat
Checklist is a ready-to-do list that helps to keep reporting of the work progress on a specific project. The tool contains templates with an extensive list of project development parameters where you can also add your own items and plans.
Try Checklist now

Learn how to get the most out of Serpstat

Want to get a personal demo, trial period or bunch of successful use cases?

Send a request and our expert will contact you ;)

Rate the article on a five-point scale

The article has already been rated by 0 people on average out of 5
Found an error? Select it and press Ctrl + Enter to tell us

Share this article with your friends

Sign In Free Sign Up

You’ve reached your query limit.

Or email
Forgot password?
Or email
Back To Login

Don’t worry! Just fill in your email and we’ll send over your password.

Are you sure?

Awesome!

To complete your registration you need to enter your phone number

Back

We sent confirmation code to your phone number

Your phone Resend code Queries left

Something went wrong.

Contact our support team
Or confirm the registration using the Telegram bot Follow this link
Please pick the project to work on

Personal demonstration

Serpstat is all about saving time, and we want to save yours! One of our specialists will contact you and discuss options going forward.

These may include a personal demonstration, a trial period, comprehensive training articles & webinar recordings, and custom advice from a Serpstat specialist. It is our goal to make you feel comfortable while using Serpstat.

Name

Email

Phone

We are glad of your comment
Upgrade your plan

Upgrade your plan

Export is not available for your account. Please upgrade to Lite or higher to get access to the tool. Learn more

Sign Up Free

Спасибо, мы с вами свяжемся в ближайшее время

Invite
View Editing

E-mail
Message
Optional
E-mail
Message
Optional

You have run out of limits

You have reached the limit for the number of created projects. You cannot create new projects unless you increase the limits or delete existing projects.

I want more limits