How to Block AdsBot-Google

Complete guide to blocking AdsBot-Google (Google) from crawling your website using robots.txt, server configuration, and Switch workflows.

Operated by GoogleMonitoring

Should You Block AdsBot-Google?

Not recommended: AdsBot-Google is a monitoring service. If it's configured for your site, blocking it will prevent you from receiving uptime alerts.

Only block if this monitoring traffic is not yours and is coming from another party.

Blocking Methods

1robots.txt

High for cooperative crawlers

Add a Disallow rule for AdsBot-Google's user-agent string in your robots.txt file. This is the standard, cooperative method that well-behaved crawlers respect.

2Server-side UA filtering

High

Configure your web server (nginx, Apache, Cloudflare) to reject requests matching AdsBot-Google's user-agent patterns. This blocks at the network level before your application processes the request.

3Switch Journey Workflows

Highest — granular, real-time control

Create a custom journey in Switch that detects AdsBot-Google and routes it to a block action, challenge, redirect, or modified content — without touching your server configuration.

robots.txt — Block AdsBot-Google

Add the following to your robots.txt file (at the root of your domain) to block AdsBot-Google:

User-agent: AdsBot-Google
Disallow: /

User-agent: Mediapartners-Google
Disallow: /

robots.txt — Allow with Restrictions

Alternatively, allow AdsBot-Google on most pages while blocking specific directories:

User-agent: AdsBot-Google
Disallow: /private/
Allow: /

User-agent: Mediapartners-Google
Disallow: /private/
Allow: /

AdsBot-Google User-Agent Strings

Use these patterns to identify AdsBot-Google in your server logs or firewall rules:

AdsBot-Google
Mediapartners-Google

Frequently Asked Questions

Does blocking AdsBot-Google affect my Google search rankings?

No. Blocking AdsBot-Google does not affect your Google search rankings. Only blocking Googlebot impacts Google Search visibility.

Does AdsBot-Google respect robots.txt?

Yes, AdsBot-Google respects robots.txt directives. Adding a Disallow rule for its user-agent will prevent it from crawling blocked paths.

Can I allow AdsBot-Google on some pages but not others?

Yes. Use robots.txt to disallow specific directories, or use Switch journey workflows for granular page-level control with conditional logic.

Go beyond robots.txt

Switch detects AdsBot-Google in real-time and lets you build custom journey workflows — block, challenge, redirect, or serve modified content. No server changes required.

Get Started Free