The user agent is the software that makes a request to a web server on behalf of a user, and the name of its HTTP request header. In the header, the client names itself, for example as a browser, a crawler or a command-line tool. Servers use it to decide how to respond, and log files record it, which makes it the standard way to tell Googlebot from a normal browser visit.
How is the header structured?
The value consists of product tokens with optional comments in parentheses. Browsers begin with Mozilla/5.0 for historical reasons and then add system and engine details. Crawlers add their own name. Examples (the Chrome version number changes over time):
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36
Mozilla/5.0 (Linux; Android 6.0.1; Nexus 5X Build/MMB29P) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/W.X.Y.Z Mobile Safari/537.36 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)
The second line is Google’s smartphone crawler, where W.X.Y.Z stands for the current Chrome version. Modern browsers also shorten the string, for instance by freezing the platform version, to limit fingerprinting. Detailed device data is then available through User-Agent Client Hints.
Why does it matter for SEO?
- robots.txt. A group starts with
User-agent: Googlebot. The value there is the crawler’s token, which is shorter than the full header string. - Log files. Requests can be grouped by crawler to see which bots visit and how often.
- Testing. Crawlers and browser extensions can send a different user agent to see what a server returns to a crawler.
- Different content per client. MDN advises against switching content by user agent because detection is unreliable. For search crawlers, showing them different content than users is cloaking.
Can the user agent be faked?
Yes. Any client can send any string, and Google states that the user agent can be spoofed. A request that claims to be Googlebot can be verified through a reverse DNS lookup followed by a forward lookup, or by checking the IP address against the ranges Google publishes.
Sources
- User-Agent header – MDN Web Docsdeveloper.mozilla.org
- RFC 9110: HTTP Semantics, section 10.1.5 User-Agentrfc-editor.org
- Google's common crawlers – Google Search Centraldevelopers.google.com
- Verifying Googlebot and other Google crawlers – Google Search Centraldevelopers.google.com
- User agent – Wikipedia (secondary)en.wikipedia.org
Last updated: