How to Block Baiduspider
Complete guide to blocking Baiduspider (Baidu) from crawling your website using robots.txt, server configuration, and Switch workflows.
Should You Block Baiduspider?
Caution: Baiduspider is a search engine crawler. Blocking it will remove your pages from Baidu's search index, which directly impacts your organic traffic and visibility.
Only block Baiduspider if you intentionally want to de-index your site from Baidu. Instead, consider using Switch to serve optimized content or manage specific page access.
Blocking Methods
1robots.txt
High for cooperative crawlersAdd a Disallow rule for Baiduspider's user-agent string in your robots.txt file. This is the standard, cooperative method that well-behaved crawlers respect.
2Server-side UA filtering
HighConfigure your web server (nginx, Apache, Cloudflare) to reject requests matching Baiduspider's user-agent patterns. This blocks at the network level before your application processes the request.
3Switch Journey Workflows
Highest — granular, real-time controlCreate a custom journey in Switch that detects Baiduspider and routes it to a block action, challenge, redirect, or modified content — without touching your server configuration.
robots.txt — Block Baiduspider
Add the following to your robots.txt file (at the root of your domain) to block Baiduspider:
User-agent: Baiduspider Disallow: / User-agent: baiduspider Disallow: /
robots.txt — Allow with Restrictions
Alternatively, allow Baiduspider on most pages while blocking specific directories:
User-agent: Baiduspider Disallow: /private/ Allow: / User-agent: baiduspider Disallow: /private/ Allow: /
Baiduspider User-Agent Strings
Use these patterns to identify Baiduspider in your server logs or firewall rules:
Frequently Asked Questions
Does blocking Baiduspider affect my Google search rankings?
No. Blocking Baiduspider does not affect your Google search rankings. Only blocking Googlebot impacts Google Search visibility.
Does Baiduspider respect robots.txt?
Yes, Baiduspider respects robots.txt directives. Adding a Disallow rule for its user-agent will prevent it from crawling blocked paths.
Can I allow Baiduspider 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 Baiduspider in real-time and lets you build custom journey workflows — block, challenge, redirect, or serve modified content. No server changes required.
Get Started Free