DeepSeek is a controversial Chinese AI-powered search and data analysis tool that crawls websites to gather and process information. If you’re a publisher and want to prevent DeepSeek from accessing your content, you can use a combination of robots.txt rules, server configurations, and firewall settings to attempt to block it. Different tactics have different levels of effectiveness.
This guide walks you through different methods on how to block DeepSeek from scraping your website(s).
Blocking DeepSeek Using robots.txt
The first and simplest way to stop any bot from crawling a website is by using the robots.txt
file.
Step-by-Step Instructions:
- Locate or Create a robots.txt File
- The
robots.txt
file is usually found in the root directory of your website (e.g.,https://example.com/robots.txt
). - If you don’t have one, create a new plain text file named
robots.txt
.
- The
- Add the Following Rule to Block DeepSeek:
User-agent: DeepSeekBot
User-agent: DeepSeek
Disallow: /
prevents it from accessing any part of your site.
- Save and Upload the File
- Save the file and upload it to your website’s root directory using FTP, SSH, or your web hosting control panel.
Limitations:
robots.txt
is a polite request and relies on the bot respecting your request. It is doubtful that a Chinese company like DeepSeek will respect the rules of a robots file. So, if DeepSeek ignores therobots.txt
, you’ll need stronger methods like firewall rules.
Blocking DeepSeek Using .htaccess (Apache Servers)
If your website runs on an Apache server, you can also block DeepSeek using .htaccess
rules. This method is effective if the bot identifies itself with a known user-agent string. However, some bots may use misleading or random user-agent strings to bypass such filters.
Step-by-Step Instructions:
- Locate or Create a .htaccess File
- The
.htaccess
file is typically in your website’s root directory. - If you don’t have one, create a new file named
.htaccess
.
- The
- Add the Following Rule to Block DeepSeek:
RewriteEngine On RewriteCond %{HTTP_USER_AGENT} DeepSeekBot [NC] RewriteRule .* - [F,L]
RewriteCond %{HTTP_USER_AGENT} DeepSeekBot [NC]
detects DeepSeek’s bot.RewriteRule .* - [F,L]
blocks access, returning a 403 Forbidden error.
- Save and Upload the File
- Save the
.htaccess
file and upload it to your website’s root directory.
- Save the
Limitations:
- This method works only if DeepSeek identifies itself as “DeepSeekBot.”
- Some bots disguise their user-agent, requiring IP-based blocking.
Blocking DeepSeek by IP Address (Using Firewall or .htaccess)
If DeepSeek ignores both your robots.txt
and .htaccess
requests, blocking its IP addresses is the next step.
Web crawlers often use a range of IP addresses that can change over time, making this method less reliable unless specific IPs are identified through server logs. Also, there is no publicly available list of IP addresses associated with DeepSeek’s web crawler. At least not right now. But that might change in the near future.
Option 1: Blocking via .htaccess
If you’ve identified DeepSeek’s IPs, add them to .htaccess
:
Deny from 000.000.0.000
Deny from 000.000.0.000/24
- Replace the “000.000.0.000” IPs with actual DeepSeek IP addresses you find in your logs.
- This method blocks access completely from these IPs.
Option 2: Blocking via Firewall (Linux Servers – iptables)
Run the following command to block DeepSeek’s IPs:
sudo iptables -A INPUT -s 000.000.0.000 -j DROP
- Replace
000.000.0.000
with DeepSeek’s actual IP. - For multiple IPs, repeat the command.
Option 3: Using Cloudflare or Web Application Firewall (WAF)
If your site uses Cloudflare, AWS WAF, or another firewall service, you can:
- Create a custom rule to block DeepSeek’s known IPs.
- Set up a challenge (CAPTCHA) for suspected bot traffic.
Blocking DeepSeek with JavaScript (For Scraping Prevention)
If DeepSeek is scraping data using browser-based automation, JavaScript can help block access. However, many advanced bots do not execute JavaScript, rendering this method ineffective against them. But it doesn’t hurt to try.
Example: JavaScript-Based User-Agent Blocking
Add this script to your website’s <head>
section:
<script>
if (navigator.userAgent.includes("DeepSeekBot")) {
document.body.innerHTML = "Access Denied";
}
</script>
- This method only works for scrapers using JavaScript-enabled browsers.
- It does not work against headless bots that ignore JavaScript.
Monitoring and Testing Your Blocks
Bot blocking is not entirely a set it and forget effort. Ongoing effort will be required to monitor and adjust your blocking efforts.
Check if DeepSeek Still Accesses Your Site
After applying these blocks, monitor your server logs:
grep -i "DeepSeekBot" /var/log/apache2/access.log
- If you still see requests from DeepSeek, it may be using different IPs or user agents.
Test Your robots.txt Rules
Use Google’s robots.txt Tester tool (Google Search Console > Crawl > robots.txt Tester
).
Use a Honeypot to Catch Scrapers
- Add an invisible link (
display: none
) and monitor who clicks it. - Scrapers will follow it, allowing you to detect and block them.
How To Block Deepseek

Blocking DeepSeek (or any web scraper) requires a layered approach:
✔ Start with robots.txt
for polite bots.
✔ Use .htaccess
or firewall rules for stricter blocking.
✔ Monitor logs for IP addresses and suspicious behavior.
✔ Use JavaScript or honeypots for advanced protection.
If DeepSeek continues scraping despite these blocks, sadly, there’s not much that you can do. A lawsuit against a Chinese company will be costly and may not generate any results. Good luck!

Frank Wilson is a retired teacher with over 30 years of combined experience in the education, small business technology, and real estate business. He now blogs as a hobby and spends most days tinkering with old computers. Wilson is passionate about tech, enjoys fishing, and loves drinking beer.