Generate robots.txt Disallowing /api/ & /admin/
This utility instantly generates a `robots.txt` file pre-configured to disallow common sensitive paths: `/api/`, `/admin/`, and `/dashboard/`. Crucially, all processing occurs entirely within your browser, ensuring no tokens, logs, or proprietary configurations ever leave your device or hit third-party servers.
Workflow Checklist
- Verify `robots.txt` is accessible at `yourdomain.com/robots.txt` (HTTP 200 OK).
- Check Google Search Console's `robots.txt` Tester for any warnings or errors.
- Confirm `/api/`, `/admin/`, and `/dashboard/` are explicitly listed under `Disallow:` directives.
- Ensure no critical public assets (CSS, JS) are inadvertently blocked by new rules.
Parent Tool & Hub
Step-by-Step Guide: Generate robots.txt Disallowing /api/ & /admin/
Follow these exact steps to complete this workflow locally in your browser without uploading files.
- 1
Review Pre-configured Disallow Paths
Observe the pre-loaded `Disallow` directives for `/api/`, `/admin/`, and `/dashboard/` in the tool's output. Verify these paths match your intended exclusions for search engine crawlers.
Tip: Do not add `/` alone; this disallows your entire site. - 2
Add Custom Disallow Directives
If needed, append additional `Disallow` paths (e.g., `/private-docs/`) to the generated content using the provided input field. Each path should be on a new line.
Tip: Use wildcards (e.g., `/*.json`) for pattern-based blocking. - 3
Specify User-Agent Directives
By default, `User-agent: *` applies to all bots. If specific crawlers (e.g., `Googlebot`) require different rules, add them before clicking 'Generate'.
Tip: More specific `User-agent` rules override generic `*` rules. - 4
Generate and Copy robots.txt
Click the 'Generate robots.txt' button. The updated content will appear in the output area. Use the 'Copy to Clipboard' button to quickly grab the file's contents.
Tip: Verify the copied text matches the output exactly before pasting. - 5
Deploy to Website Root
Paste the copied `robots.txt` content into a new file named `robots.txt` and upload it to the root directory of your web server (e.g., `yourdomain.com/robots.txt`).
Tip: Confirm accessibility via `yourdomain.com/robots.txt` in a browser.
Technical Specifications & Preset Reference
| Parameter | Recommended Setting | Why It Matters |
|---|---|---|
| Disallow Paths | /api/, /admin/, /dashboard/ | These paths are pre-configured to prevent sensitive API endpoints, admin panels, and user dashboards from being indexed. |
| User-agent | User-agent: * | The wildcard `*` ensures these disallow rules apply universally to all web crawlers, providing broad protection. |
| Processing Location | Browser-local (Client-side) | Zero bytes are uploaded, ensuring sensitive path information or custom rules never leave your browser, maintaining privacy. |
| Output Format | Plain Text (.txt) | The standard plain text format is universally recognized by search engine crawlers and web servers for `robots.txt` files. |
| Character Encoding | UTF-8 | UTF-8 encoding ensures all characters, including special symbols in path names, are correctly interpreted by crawlers. |
Common Issues & Troubleshooting Fixes
Accidentally blocking entire site with `/`
Ensure you only specify sub-paths like `/admin/` or `/api/`. Never use `Disallow: /` unless you intend to block all crawling.
Incorrect `robots.txt` file name or location
The file MUST be named `robots.txt` (lowercase) and placed in the root directory of your domain (e.g., `https://example.com/robots.txt`).
Disallow rules not taking effect immediately
Search engine crawlers cache `robots.txt` files. It can take hours to days for changes to propagate. Use Google Search Console's `robots.txt` Tester.
Blocking CSS/JS for Googlebot
Googlebot needs to access CSS and JavaScript to render pages correctly. Do not block these assets unless absolutely necessary for specific paths.
Why Run This Workflow Locally in ShowPro?
Unlike remote `robots.txt` generators that require pasting sensitive path information into a server-side form, this tool processes everything client-side. Your specific `/api/` or `/admin/` path details never leave your browser, eliminating any privacy risks associated with transmitting potentially sensitive internal URL structures to a third party.
Frequently Asked Questions
Can I block specific files like `config.json`?
Yes, you can add `Disallow: /config.json` to block a specific file. For files within a directory, use `Disallow: /path/to/file.ext`. Be precise with your paths.
Will this prevent direct access to `/admin/`?
No, `robots.txt` only guides search engine crawlers. It does not prevent users or malicious actors from directly accessing blocked URLs. Secure your admin panels with authentication.
How do I allow a sub-path within a disallowed directory?
Use an `Allow:` directive before the `Disallow:` for the broader path. For example: `Allow: /admin/public/` followed by `Disallow: /admin/`. Order matters for specific crawlers.
What if I have multiple `User-agent` blocks?
Each `User-agent` block applies its rules to that specific bot. A more specific `User-agent` rule (e.g., `Googlebot`) will override the general `User-agent: *` rules for that bot.
Is it safe to use this for production websites?
Absolutely. Since all processing happens locally in your browser, no data is ever uploaded. This tool simply provides the correctly formatted `robots.txt` content for you to deploy.