User agent
The User-Agent header names the software making a request. See real browser and Googlebot strings, how to find bots in your logs, and why it can be faked.
A user agent is the software making an HTTP request, and the User-Agent request header is the string that identifies it: application, operating system, vendor or version. Browsers and crawlers both send one. Because any client can send any value, a user-agent string alone never proves who a bot really is.
Is this costing your site traffic?
Four quick questions, then a straight answer.
From your answers, this is quietly costing you traffic and nobody has the hours to chase it. Scaplet finds every affected page, drafts the fixes and tracks how AI answers mention you.
- Free audit in 60 seconds
- Fixes drafted for your review
- ChatGPT, Perplexity, Gemini and AI Overviews tracked
A data platform shipped 46 fixes without a ticket.
This looks handled. Re-check after a redesign, a migration or a big content push; that is when it breaks.
- Re-check after big site changes
- Keep this page for reference
Your site is small and you have the time. Work through the steps on this page, starting with the pages that get the most traffic.
- Follow the steps below
- Top-traffic pages first
- Check again in a month
4 parts, 3 minutes.
What a user-agent string looks like
Mozilla/5.0, and MDN's examples show crawler strings such as Googlebot's carry the same prefix.Browsers now expose less detail in this string for privacy. MDN points developers who need specifics to User-Agent Client Hints, requested through the Accept-CH response header.
# Chrome on desktop
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36
# Googlebot
User-Agent: Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)Why it matters for SEO
User-agent line. Your server logs record who fetched what, which is how you see Googlebot, Bingbot and AI crawlers hit your pages. And rules at the server or CDN can allow or block a bot by its string.Do not serve different content to browsers and crawlers based on this header. MDN calls serving different content to different browsers by parsing the User-Agent usually a bad idea, and Google's spam policies define cloaking as presenting different content to users and search engines with the intent to manipulate rankings, including text inserted only when the requesting user agent is a search engine. Use responsive CSS and feature detection for layout instead.
Find crawlers in your logs
- 1
Reverse DNS
Run
host <ip>on the address from your log. Google says to verify that the domain name isgooglebot.com,google.com, orgoogleusercontent.com. - 2
Forward DNS
Run
host <hostname>and confirm it resolves back to the same IP. - 3
Or match published ranges
Google publishes JSON files of crawler IP ranges in CIDR notation. Compare the request IP against them in code.
awk -F'"' '{print $6}' /var/log/nginx/access.log | grep -Ei 'bot|crawler' | sort | uniq -c | sort -rn | head -20A string that says Googlebot is a claim, not proof. Google's documentation notes that spammers or other troublemakers might falsely claim to be Google, so verify the IP.
Target a crawler in robots.txt
User-agent line naming the crawler it applies to. User-agent: * matches all crawlers except AdsBot, which must be named explicitly.Robots.txt is voluntary. It only works for crawlers that respect it and is not a security mechanism. Google's robots.txt guide says that to keep information secure from crawlers, use other blocking methods, such as password-protecting private files on your server.
User-agent: GPTBot
Disallow: /
User-agent: *
Allow: /Asked a lot.
4 questions people ask next, answered from the sources on this page.
01Can a crawler fake its user agent?
Yes. The client chooses the value, so any bot can claim to be Googlebot or a browser. Verify claimed Google crawlers with reverse and forward DNS lookups or by matching Google's published IP ranges.
02How do I see my own browser's user agent?
Open DevTools, go to the Network tab, click any request and read the User-Agent request header. In the console, navigator.userAgent prints the same string.
03Should I serve different pages based on user agent?
Generally no. MDN says serving different content to different browsers is usually a bad idea. Use responsive design and feature detection, and give crawlers the same content as users.
04What is the Googlebot user agent?
One string MDN lists is Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html). Google's page on verifying Google requests explains how to confirm a request really comes from Google.
Every fact, linked and dated.
mozilla.org
google.com
- 01User-Agent header - MDN Web Docsdeveloper.mozilla.org · checked 2026-10-24
- 02Browser detection using the user agent - MDN Web Docsdeveloper.mozilla.org · checked 2026-10-24
- 03Verifying Google crawler requests - Google Search Centraldevelopers.google.com · checked 2026-10-24
- 04How to write and submit a robots.txt file - Google Search Centraldevelopers.google.com · checked 2026-10-24
- 05Spam policies for Google web searchdevelopers.google.com · checked 2026-10-24
Keep learning
All glossaryKnow the term. Now check your site.
The free audit reads robots.txt, sitemaps, status codes, canonicals, redirects and structured data.
- 46 fixes shipped without a ticket Brightpipe
- +212% organic clicks in 90 days Ledgerly