What Is robots.txt?
Robots.txt may be a file that tells search engine crawlers to not crawl certain pages or sections of an internet site . Most major search engines (including Google, Bing and Yahoo) recognize and honor robots.txt requests that is very helpful n SEO. If you want to know about SEO this page will guide you all you need to know.
Why Is robots.txt in SEO Important ?
Most websites don’t need to use a robots.txt file. That’s because Google can usually find and index all of the important pages on your site. And they’ll automatically NOT index pages that aren’t important or duplicate versions of other pages. That said, there are 3 main reasons that you’d want to use a robots.txt file.
Block Non-Public Pages
Sometimes you’ve got pages on your site that you simply don’t want indexed. For example, you might have a staging version of a page or a login page. These pages need to exist. But you don’t want random people landing on them. This is a case where you’d use robots.txt to dam these pages from program crawlers and bots.
Maximize Crawl Budget
If you’re having a troublesome time getting all of your pages indexed, you would possibly have a crawl budget problem. By blocking unimportant pages with robots.txt, Googlebot can spend more of your crawl budget on the pages that really matter.
Prevent Indexing of Resources
Using Meta directives can work even as well as Robots.txt for preventing pages from getting indexed. However, Meta directives don’t work well for multimedia resources, like PDFs and pictures . That’s where robots.txt comes into play.
The bottom line? Robots.txt tells search engine crawlers to not crawl specific pages on your website. You can check how many pages you have indexed in the Google Search Console. If the amount matches the amount of pages that you simply want indexed, you don’t got to bother with a Robots.txt file.
But if that number of higher than you expected (and you notice indexed URLs that shouldn’t be indexed), then it’s time to create a robots.txt file for your website.
Create a Robots.txt File
Your initiative is to truly create your robots.txt file. Being a document , you’ll actually create one using Windows notepad. And regardless of how you ultimately make your robots.txt file, the format is strictly the same:
User-agent is that the specific bot that you’re lecture . And everything that comes after “disallow” are pages or sections that you want to block. Here’s an example:
This rule would tell Googlebot to not index the image folder of your website. You can also use an asterisk (*) to speak to any and all bots that stop by your website.
Here’s an example:
The “*” tells any and every one spiders to NOT crawl your images folder. Make Your Robots.txt File Easy to Find. Once you have your robots.txt file, it’s time to make it live. You can technically place your robots.txt enter any main directory of your site. But to extend the chances that your robots.txt file gets found, i like to recommend placing it at:
(Note that your robots.txt file is case sensitive. So make sure to use a lowercase “r” in the filename)
Make Your Robots.txt File Easy to Find
Once you have your robots.txt file, it’s time to make it live. You can technically place your robots.txt enter any main directory of your site. But to extend the chances that your robots.txt file gets found, i like to recommend placing it at:
(Note that your robots.txt file is case sensitive. So make sure to use a lowercase “r” in the filename). This is only one of the many ways to use a robots.txt file. This helpful guide from Google has more info the various rules you’ll use to dam or allow bots from crawling different pages of your site.