Instructing Google Not to Index Your Web Page: Noindex, Nofollow HTML Metatags
Most of the time we are excited when Google or another search engine finds our web pages and serves it to people.
But there may be times when you want to hide specific pages from search results.
We can use HTML metatags, specifically the Noindex
and Nofollow
tags, to achieve this.
For example, here on Codú, we ship pages in increments and test them under a secret URL to ensure they work as expected on the live site. But these aren't something we want search engines to serve just yet.
Let's look at how easy it is to add a little snippet of HTML metadata to stop the indexing from happening.
Noindex Tag
The Noindex metatag tool tells search engine robots not to index a particular page on your website. When the Noindex tag is applied, the specified webpage won't be included in search engine results.
Here's how you use it, simply add this line of code within the <head>
section of your HTML:
<meta name="robots" content="noindex">
Nofollow Tag
The Nofollow metatag is slightly different. It instructs search engine bots not to follow or crawl any links on a webpage. So, even if the page itself is indexed, the search engines won't index any linked pages.
Just like with the Noindex tag, you can implement the Nofollow tag by adding this line to your webpage's HTML <head>
section:
<meta name="robots" content="nofollow">
Combining Noindex and Nofollow
When you use this combination, you're instructing search engine bots not to index the current page and not to crawl any links found on this page.
This can be done by adding both attributes to the content attribute. Here's how:
<meta name="robots" content="noindex, nofollow">
Keep in mind, while these metatags can help you control how search engines interact with your pages, they won't prevent users from accessing your pages directly if they have the URL.
With that said, you're now equipped to manage the visibility of your web pages on search engine results more effectively.
Follow me on Twitter or connect on LinkedIn.
🚨 Want to make friends and learn from peers? You can join our free web developer community here. 🎉