A new site needs a robots.txt file at the root of the domain. It is tiny, but a wrong line can keep your pages out of search results. The Robots.txt Generator builds a correctly formatted file so you do not have to remember the syntax.
Robots.txt Generator FREE online toolRuns in your browser. No sign-up, nothing to install. Open the tool →What robots.txt does
The file tells crawlers which parts of your site they may request. It lives at yourdomain.com/robots.txt, and crawlers check it before fetching pages. It is a set of requests that well-behaved crawlers follow, not a security feature. Anyone can still open a URL you disallowed.
It also controls crawling, not indexing. A page blocked in robots.txt can still appear in search results as a bare link if other sites link to it. To keep a page out of results, use a noindex directive on the page itself.
Create the file
- Open the Robots.txt Generator.
- Set the default rule for all crawlers to allow, so your public pages can be crawled.
- Add disallow rules for any private areas, such as a login folder or a cart.
- Enter the full address of your sitemap, for example https://example.com/sitemap.xml.
- Copy the generated text, save it as robots.txt and upload it to the root of your site.
- Open yourdomain.com/robots.txt in a browser to confirm it loads.
A minimal, safe file
For most small sites the following is enough: a line User-agent: * followed by an empty Disallow: line, which means nothing is blocked, and a Sitemap line with the full address. That tells every crawler it is welcome and where to find your page list.
Keep it simple. The more rules you add, the easier it is to block something by accident.
Mistakes that hurt
- Leaving Disallow: / in place from the staging site, which blocks the entire website.
- Using a relative address for the sitemap. It must be a full URL.
- Blocking CSS or JavaScript files that search engines need to display the page.
- Putting the file in a subfolder. It only works at the root.
- Writing rules with a capital letter in the wrong place; paths are case-sensitive.
Check it after launch
Open the live file and read it once more. Search engine webmaster tools offer a robots.txt report that shows how the file was read and flags errors. Then try a few URLs you expect to be crawlable, such as your homepage and a product page, and confirm none of them is blocked.
Revisit the file whenever you restructure the site. A new folder for members or an internal search results page is a common reason to add a rule.
AI crawlers and other bots
You can add separate groups for particular crawlers, each beginning with its own User-agent line. Reputable bots follow them, but malicious ones ignore the file, so it is not protection. Decide what you want for each case, and keep the wildcard group simple.
Sitemaps and robots together
The sitemap lists the pages you want found. The robots file says where crawlers may go. Having both gives search engines a clear picture. If your site is new, also submit the sitemap directly in the search console of each engine you care about, which usually gets pages discovered faster than waiting for the crawler to find them by links alone.
Comments (0)
No comments yet. Be the first to share a thought.