I heard that this method will violate some of the operating principles of search engines, may be punished by the search engines, or even delete the site. So I've just withdrawn this deal until I'm sure it doesn't belong to cheating. Courageous friends can continue to use, but the consequences at their own risk.
The homepage and archive page of this blog displays the article in the form of a list, and the content of the article is loaded when the visitor clicks to expand the article. Because the content part of the article contains a lot of text and pictures, need a lot of loading time and traffic. displaying pages to visitors as quickly as possible can retain a large number of visitors. And for mobile phone users, load time and traffic is more important.
Generally speaking, the homepage of the website is the search engine to visit the most pages, should be as far as possible to show them meaningful content, but to display articles in the form of a list, visitors and search engines can only get the article title information. The content of the article or the abstract (especially the first sentence of the article) is extremely important for SEO, so we have to try to send these content to the crawler.
OK, we can use the User Agent to determine whether the visitor is a reptile, and if so, display the article in general form, otherwise the list of articles will be displayed in the form of a listing. You can use the following PHP method to determine whether you are a reptile:
Copy Code code as follows:
function Is_crawler () {
$userAgent = Strtolower ($_server[' http_user_agent '));
$spiders = Array (
' Googlebot ',//Google crawler
' Baiduspider ',//Baidu Crawler
' Yahoo! Slurp ',//Yahoo crawler
' Yodaobot ',//Youdao Reptile
' MSNBot '//Bing Crawler
More Reptile Keywords
);
foreach ($spiders as $spider) {
$spider = Strtolower ($spider);
if (Strpos ($userAgent, $spider)!== false) {
return true;
}
}
return false;
}
This is the way I use the crawler to sort by access comments from high to low. And then show the different content to the reptile and the natural person through the following method