Mediapartners-Google user agent
Operated by Google
Mediapartners-Google is the AdSense crawler that reads pages to show relevant ads on them.
The Mediapartners-Google bot at a glance
- Mediapartners-Google is operated by Google and checks landing pages for an advertising platform.
- The robots.txt token for Mediapartners-Google is Mediapartners-Google.
- Blocking a platform fetcher has no effect on organic search rankings.
- Mediapartners-Google robots.txt support: Yes.
- Recommendation for Generative Engine Optimization (GEO): Allow.
What is Mediapartners-Google?
Mediapartners-Google visits pages that carry AdSense code so Google can match ads to the page content.
Blocking it on an AdSense site can lower ad relevance and earnings.
Should you block Mediapartners-Google?
Allow Mediapartners-Google unless it causes a measurable load problem.
| Effect on search rankings | Blocking a platform fetcher has no effect on organic search rankings. |
|---|---|
| Effect on AI visibility | Blocking breaks the feature the fetcher serves, such as ad approval or feed updates. |
| Follows robots.txt | Yes |
| Recommendation | Allow |
How to block or allow Mediapartners-Google
Put the robots.txt rule in the file at the root of every domain and subdomain, for example https://example.com/robots.txt. The token Mediapartners-Google is matched case-insensitively.
robots.txt: block
# Block Mediapartners-Google
User-agent: Mediapartners-Google
Disallow: /robots.txt: allow
# Allow Mediapartners-Google
User-agent: Mediapartners-Google
Allow: /robots.txt: partial
# Keep Mediapartners-Google out of private areas only
User-agent: Mediapartners-Google
Disallow: /wp-admin/
Disallow: /cart/
Disallow: /checkout/
Disallow: /my-account/
Allow: /Nginx
# Nginx: return 403 to Mediapartners-Google
if ($http_user_agent ~* "(Mediapartners\-Google)") {
return 403;
}Apache
# Apache .htaccess: return 403 to Mediapartners-Google
RewriteEngine On
RewriteCond %{HTTP_USER_AGENT} (Mediapartners\-Google) [NC]
RewriteRule .* - [F,L]Cloudflare WAF
# Cloudflare > Security > WAF > Custom rule, action: Block
(http.user_agent contains "Mediapartners-Google")How to verify real Mediapartners-Google traffic
Google publishes the IP ranges that Mediapartners-Google uses. A request with the Mediapartners-Google user agent from an IP outside that list is an impersonator.
Official Mediapartners-Google IP list (JSON)
Reverse DNS check: look up the request IP, confirm the hostname ends in google.com, then look up that hostname and confirm it returns the same IP.
# 1. Reverse lookup: the hostname must end in google.com
host REQUEST_IP
# 2. Forward lookup: must return the same REQUEST_IP
host HOSTNAME_FROM_STEP_1How to find Mediapartners-Google in your server logs
Search the web server access log for the token. The command below counts Mediapartners-Google requests per URL on Nginx or Apache.
grep -i "Mediapartners-Google" access.log | awk '{print $7}' | sort | uniq -c | sort -rn | head -20For a full report per AI bot, upload the log to the AI Log File Analyzer, a free tool by Justin Hà.
Mediapartners-Google FAQ
Mediapartners-Google uses the robots.txt token "Mediapartners-Google". Google does not publish a full user-agent string, so match the token inside the User-Agent header.
Yes. Google states that Mediapartners-Google follows robots.txt rules written for the "Mediapartners-Google" token.
Blocking a platform fetcher has no effect on organic search rankings. Blocking breaks the feature the fetcher serves, such as ad approval or feed updates.
Add two lines to the robots.txt file at the root of each domain and subdomain: "User-agent: Mediapartners-Google" followed by "Disallow: /". The token is case-insensitive. Changes can take up to 24 hours to be picked up.
Yes. Google publishes the IP ranges Mediapartners-Google uses. Check the request IP against that list; a matching user agent from any other IP is an impersonator.
Search your server access log for "Mediapartners-Google", for example with: grep -i "Mediapartners-Google" access.log. The AI Log File Analyzer by Justin Hà counts visits per AI bot from an uploaded log file.
Sources: Google crawler documentation. Last reviewed by Justin Hà.
See which of these bots actually reach your website
The AI Log File Analyzer by Justin Hà counts visits from GPTBot, ClaudeBot, PerplexityBot and other AI crawlers in your server log, for free. The GEO Technical Package sets up robots.txt, llms.txt and crawler access for AI search.