Recently, one of our users asked us how they can stop search engines from crawling and indexing their WordPress site.
There are several scenarios when you would want to stop search engines from crawling your website and listing it in search results.
In this article, we will show you how to stop search engines from crawling a WordPress site.
Why Stop Search Engines From Crawling a WordPress Site?
For most WordPress websites, search engines are the biggest source of traffic. You may ask, why would anyone want to block search engines?
Here are some situations when you won’t want search engines to index your website:
- When starting out, you may not know how to create a local development environment or a staging site, and instead develop your website while it’s live. You won’t want Google to index your site when it’s under construction or in maintenance mode.
- There are also many people who use WordPress to create private blogs. They don’t want them indexed by search engines because they’re private.
- You can use WordPress for project management or an intranet. In these cases, you won’t want your internal documents to be publicly accessible.
A common misconception is that if you don’t have links pointing to your domain, then search engines will probably never find your website. This is not completely true.
For example, there may be links pointing to your site because the domain name was previously owned by someone else. Also, there are thousands of pages on the internet that simply list domain names. Your site may appear on one of those.
With that being said, let’s take a look at how to stop search engines from crawling your website. We’ll cover four methods:
Method 1: Asking Search Engines not to Crawl Your WordPress Site
This is the simplest method but does not fully protect your website from being crawled.
WordPress comes with a built-in feature that allows you to instruct search engines not to index your site. All you need to do is visit Settings » Reading and check the box next to ‘Search Engine Visibility’.
When this box is checked, WordPress adds this line to your website’s header:
<meta name="robots" content="noindex,follow" />
WordPress also modifies your site’s robots.txt file and adds these lines to it:
User-agent: * Disallow: /
These lines ask robots (web crawlers) not to index your pages. However, it is totally up to search engines to accept this request or ignore it. Even though most search engines respect this, there’s still a chance that some pages or images from your site may get indexed.
If you want to make it impossible for search engines to index or crawl your website, then you will need to password protect your WordPress site using Methods 3 or 4.
Method 2: Asking Search Engines not to Crawl Individual Pages
You might want search engines to crawl and index your website, but not include certain posts or pages in search results pages.
The easiest way to do that is using the All in One SEO (AIOSEO) plugin. It is the best SEO tool for WordPress and is trusted by over 3 million businesses.
For this tutorial, we’ll be using the AIOSEO free version as it includes the SEO Analysis tool. There is also a premium version of AIOSEO that offers more features like sitemap tools, redirection manager, schema markup, robots.txt editor, and more.
The first thing you’ll need to do is install and activate the AIOSEO plugin on your website. You can learn how to install and configure the plugin by following our step by step guide on how to set up All in One SEO for WordPress.
Once the plugin is set up, you can use it to ask search engines not to index certain posts and pages. Again, it is totally up to search engines to accept this request or ignore it.
Simply edit the post or page that you don’t want to be indexed. You need to scroll down to AIOSEO Settings at the bottom of the WordPress editor and then click the ‘Advanced’ tab.
Notice that the article is using the default robots settings. To change this, you need to switch the ‘Use Default Settings’ toggle to the off position.
Now you can click the ‘No Index’ checkbox. Once the post is published or updated, search engines will be asked not to index it.
Method 3: Password Protecting an Entire Site Using cPanel
If your WordPress hosting provider offers cPanel access to manage your hosting account, then you can protect your entire site using cPanel. All you have to do is log in to your cPanel dashboard and then click on the ‘Directory Privacy’ icon in the ‘Files’ section.
Next, you need to find the folder where you installed WordPress. Usually, it is the public_html folder. After that, you need to click the ‘Edit’ button next to that folder.
Note: If you have multiple WordPress sites installed under public_html directory, then you need to click on the public_html link to browse those sites, and then edit the folder for the website you want to password protect.
This brings you to a screen where you can turn on password protection.
Simply check the box that says ‘Password protect this directory’ and click the ‘Save’ button. If you like, you can also customize the name for the protected directory.
You will see a confirmation message saying that the access permissions for the directory have been changed.
Next, you should click the ‘Go Back’ button.
You’ll be taken to a screen where you can create a username and password that will need to be used when accessing this directory.
You need to enter a username and password and then confirm the password. Make sure to note your username and password in a safe place, such as a password manager app.
Once you click the ‘Save’ button you have successfully added password protection to your WordPress site.
Now, whenever a user or search engine visits your website they will be prompted to enter the username and password you created earlier to view the site.
Method 4: Password Protecting WordPress With a Plugin
If you are using a managed WordPress hosting solution, then you may not have access to cPanel. In that case, you can use a WordPress plugin to password protect your site.
Here are the two most popular solutions:
- SeedProd is the #1 coming soon and maintenance mode plugin for WordPress, used on over 800,000 websites. It comes with complete access control and permissions features that you can use to hide your website from everyone including search engines. We have a step by step how-to guide for SeedProd.
- Password Protected is a very simple way to password protect your WordPress site with a single password (no user creation needed). See our step by step guide on how to password protect a WordPress site.
We hope this article helped you stop search engines from crawling or indexing your WordPress site. You may also want to learn how to speed up your website performance, or see our ultimate step by step WordPress security guide for beginners.
If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.
The post How to Stop Search Engines from Crawling a WordPress Site first appeared on WPBeginner.