In order to improve the user experience of web pages, we often do things that are not friendly to search engines, but in some cases this is not irreversible. We can display different content to natural people and search engine robots. content to provide a good user experience and SEO.
I heard that this method will violate some operating principles of search engines, and may be punished by various search engines, or even delete the website. So I have just removed this treatment until I am sure that it is not cheating. Friends who are enterprising You can continue to use it, but do so at your own risk.
The homepage and archive pages of this blog display articles in the form of a list, and the content of the article is loaded only when the visitor clicks to expand the article. Because the content of the article contains a large amount of text and pictures, it requires a lot of loading time and traffic. Displaying web pages to visitors as quickly as possible can retain a large number of visitors. For mobile users, loading time and traffic are more important.
Generally speaking, the homepage of a website is the page most visited by search engines, and meaningful content should be displayed to them as much as possible. However, if articles are displayed in the form of a list, visitors and search engines can only obtain the title of the article. Information. Article content or summary (especially the first sentence of the article) is extremely important for SEO, so we have to try to send this content to crawlers.
OK, we can use the User Agent to determine whether the visitor is a crawler. If so, the article will be displayed in a general form, otherwise the article list will be displayed in a list. You can use the following PHP method to determine whether the visitor is a crawler:
Copy to ClipboardQuoted content: [www.bkjia.com] function is_crawler() {This is the method I use, each crawler is sorted from high to low by the accessed comments. Then different content is displayed to crawlers and natural people through the following method