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.
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:
- then press the CTRL + F keys to open the search window at the top:
- enter the word "Charset" in the search and see what encoding is indicated next to it.
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.
Log in to your Browserstack service account. Select the necessary devices and run the test:
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:
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."
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, and 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.