I understand a WP cron job is activated when someone visits that particular website. But, suppose, if Google bot visits the site to index it, can it start the scheduled cron jobs?
Asked
Active
Viewed 188 times
1 Answers
0
Yes, a bot visit is same to a website like a normal user visit unless you tell the site the difference between a bot visit and a user visit.
For instance the difference between a user visit and bot visit can be checked as follows:
USER:
if (strpos(strtolower($_SERVER['HTTP_USER_AGENT']),"bot")) {
// It's a bot :)
} else {
// Otherwise it's a user
}
'HTTP_USER_AGENT'
Contents of the User-Agent: header from the current request, if there is one. This is a string denoting the user agent being which is accessing the page. A typical example is: Mozilla/4.5 [en] (X11; U; Linux 2.2.9 i586). Among other things, you can use this value with get_browser() to tailor your page's output to the capabilities of the user agent.
Take a look at the link as well:

Umair Shah
- 2,305
- 2
- 25
- 50