When search engines crawl pages, they do not look at the page from the web page like people do, but from the code of the page! Right-click the mouse and view the source file, and we can see the HTML code of the modified web page. This is what the spider wants to read. The retrieved content is read from the beginning to the end. Some people also say that it is read from top to bottom, left to right of the page. I think it is more scientific to read from the front of the HTML code to the end!
Why simplify code?
The spider reads the code from top to bottom. If you have a lot of code that has nothing to do with the text, the spider must read it first. The spider's ability is limited. It may be tired and leave before reading the text. In this case, Not to mention ranking, you must know that spiders have limited capabilities. We should not embarrass spiders, use the most streamlined code, let the text be reflected as early as possible, and let spiders crawl successfully.
How to streamline code?
1) Streamline the code. Generally speaking, our pages use DIV+CSS. Many people say that using DIV+CSS is good for SEO. I agree with this statement, but using DIV must rank better than TABLE. This is nonsense! Because The most important thing about using DIV+CSS is to streamline the code, which is beneficial to search engine crawling!
2) Externalization of irrelevant code
For example, our CSS code should be external to CSS, as well as some advertising codes, and special effects codes should be external to JS! Just call it in the web page code, which greatly simplifies the web page code.
3)Header information of the inner page
In the internal pages of the website, such as article pages and channel pages, in fact, the header information (LOGO, top advertisement, top search box), these are irrelevant information to this article page, and can be called out to make your main text in More forward in the code. Of course, you need to ensure basic navigation, such as returning to the homepage, links to each column, and internal links to the latest articles, related articles, popular articles, etc., but I think these codes should be under the text, and the first thing reflected on the article page should be The title and content of the article. . The second is these related link information. This greatly simplifies the code of the website, which is conducive to the competition of long-tail keywords in internal pages!
4) Redundant code generated by the program itself
Especially programs written in .NET will automatically generate a lot of redundant garbage code. These codes not only greatly reduce the speed of the web page, but also make spiders tired to the point of lying down. Spiders simulate human behavior. They used to work in our company A website once appeared. .NET written by programmers resulted in a large amount of redundant code on the web page. At that time, a careless person did not pay attention. Later, this batch of pages not only slowed down the speed, but was later deleted by Baidu in the search engine. A large amount of redundant code caused page similarity problems in this batch of web pages, which caused Baidu to delete the results, which was solved immediately. So we must pay very, very much attention to these issues!
Let’s summarize these 4 points first. In short, in a word, our web page code should be very streamlined, irrelevant content should be placed externally, the main content of the web page should be advanced, and the relevant content should lag behind. We must understand the mission of each web page. For example, for article pages, the top information such as the logo above is redundant code. It should be external and just refer to this principle to streamline the code.
Author: Dai Renguang@blackhumor
Blog address: http://www.dairenguang.com
URL of this article: http://www.dairenguang.com/note/20090720535.htm
When reprinting under copyright, the author, original source and this statement must be indicated in the form of a link.