11842
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" title = "How to set the site encoding correctly 16261788333996" />
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

Speed up your search marketing growth with Serpstat!

Keyword and backlink opportunities, competitors' online strategy, daily rankings and SEO-related issues.

A pack of tools for reducing your time on SEO tasks.

Get free 7-day trial

Rate the article on a five-point scale

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

Discover More SEO Tools

Tools for Keywords

Keywords Research Tools – uncover untapped potential in your niche

Serpstat Features

SERP SEO Tool – the ultimate solution for website optimization

Keyword Difficulty Tool

Stay ahead of the competition and dominate your niche with our keywords difficulty tool

Check Page for SEO

On-page SEO checker – identify technical issues, optimize and drive more traffic to your website

Share this article with your friends

Are you sure?

Introducing Serpstat

Find out about the main features of the service in a convenient way for you!

Please send a request, and our specialist will offer you education options: a personal demonstration, a trial period, or materials for self-study and increasing expertise — everything for a comfortable start to work with Serpstat.

Name

Email

Phone

We are glad of your comment
I agree to Serpstat`s Privacy Policy.

Thank you, we have saved your new mailing settings.

Report a bug

Cancel
Open support chat
mail pocket flipboard Messenger telegramm