Note: Many people want to know which spiders frequently visit their blog websites and how many times they visit. For this question, plugins are usually used to solve it. In fact, besides plugins, we can also view spider visiting records by using code. Here, I will explain the method. The code in this article was found online, and I added a few mainstream search engine spiders myself.
Method#
First, put the following code into the functions.php
file in the theme directory.
Then, create a txt
file named robotslogs.txt
in the root directory and set its permissions to 777
. After that, visit http://your_domain/robotslogs.txt
to see detailed spider visiting records.