There are a few ways to stop search engines from crawling a WordPress site.
1. Use the built-in Search Engine Visibility setting
WordPress has a built-in setting that allows you to prevent search engines from crawling your site. To find this setting, go to Settings > Reading. In the Search Engine Visibility section, check the box next to Discourage search engines from indexing this site.
2. Use a robots.txt file
A robots.txt file is a text file that tells search engines which pages on your site they can and cannot crawl. To create a robots.txt file, create a new file in your WordPress root directory and name it robots.txt
. In the robots.txt file, add the following line:
Code snippet
Disallow: /
Use code with caution. Learn morecontent_copy
This will tell search engines not to crawl any pages on your site.
3. Use a plugin
There are a number of plugins that can help you prevent search engines from crawling your site. One popular plugin is Yoast SEO. Yoast SEO has a setting that allows you to prevent search engines from crawling specific pages or posts. To find this setting, go to Yoast SEO > Search Appearance > Advanced. In the Robots Meta section, you can select the pages and posts that you want to prevent search engines from crawling.
4. Use a .htaccess file
If you have access to your server’s .htaccess file, you can use it to prevent search engines from crawling your site. To do this, add the following line to your .htaccess file:
Code snippet
Disallow: /
Use code with caution. Learn morecontent_copy
This will tell search engines not to crawl any pages on your site.
5. Use a firewall
If you have a firewall, you can use it to block search engine bots from accessing your site. To do this, add the following rules to your firewall:
- Block all requests from Googlebot
- Block all requests from Bingbot
- Block all requests from Yahoo! Slurp
6. Contact your web host
If you are still having trouble preventing search engines from crawling your site, you can contact your web host for assistance. They may be able to block search engine bots from accessing your site at the server level.