How to Create a robots.txt File for a Trades Website: Google’s Rules in Plain English
A robots.txt file tells crawlers which paths to avoid. A wrong line can hide a whole site. Google explains how to create one correctly. This guide sets out the rules in plain English.
I am Robiul Alom Ronju, Founder of Nexranking. The details are from Google Search Central. My advice for trades is marked as mine.

Name and location
The file must be named robots.txt and sit at the root of the host it governs. A site can have only one, and a subfolder location will not work. If you cannot reach the root, use another blocking method, such as meta tags.
Format
Write it as plain text saved in UTF-8. Word processors can insert stray characters, so use a basic text editor.
The rules
- Each group starts with a user-agent line naming the crawler.
- Disallow blocks a path. Allow makes an exception inside a blocked path.
- Sitemap gives the full URL of your sitemap.
- Paths are case-sensitive and a hash starts a comment. The star wildcard works in every rule except sitemap.
Scope
Rules apply only to the exact protocol, host and port where the file is posted. A subdomain, or an http version of an https site, needs its own file.
Testing
After uploading, open the file in a private window to confirm it is publicly visible. Then check it with the robots.txt report in Search Console. Google’s crawlers find and use the file automatically once it is live.
My advice for trades
This is my own advice. Most trades sites need only a Sitemap line and perhaps a block on admin or search result URLs. Never block the whole site on the live domain. Remember that blocking does not keep a page out of results, see robots.txt vs noindex.
Checklist before you upload
- Open the current file at yoursite/robots.txt and save a copy.
- Make sure there is no Disallow: / on the live site.
- Keep rules to admin and search result paths only.
- Add the sitemap line.
- Upload to the root, then re-open it in a private window.
- Check the robots.txt report in Search Console.
A worked example
Illustrative example, not a client case. A tiler’s site has Disallow: / left over from the developer’s staging build. Pages vanish from Search Console. The tiler replaces the file with three lines: a user-agent line, a disallow for the WordPress admin folder and a sitemap line, then re-tests in the robots.txt report.
Mistakes I see
- Leaving Disallow: / after launch.
- Saving the file in a word processor.
- Placing it in a subfolder.
- Expecting robots.txt to remove a page from Google.
- Forgetting that the https site needs its own file.
Also read robots meta tags and ask for an audit.
Where does robots.txt go?
At the root of the host.
What format?
Plain text in UTF-8.
Can I add my sitemap?
Yes, with a sitemap line giving the full URL.
Does it apply to subdomains?
No. Each host needs its own file.
How do I test it?
Open it in a private window and use the robots.txt report in Search Console.
Related guides
- Image Sitemaps for Trades Websites: Do Job Photos Need One?
- Organization Structured Data for a Trades Business: What Google Recommends and What It Does Not Promise
- Logo Structured Data for Trades Businesses: Size, Format and the White Background Test
Browse every guide in the local SEO guides for trades hub.
Sources
- Google Search Central, Create and submit a robots.txt file: https://developers.google.com/search/docs/crawling-indexing/robots/create-robots-txt