Robots.txt Generator(robots.txt生成)
User-agent別のAllow/Disallowルールとサイトマップをフォームで組み立ててrobots.txtを生成します。プリセット付き、コピー・ダウンロードに対応。
プリセット
User-agentグループ
Sitemap
生成結果
User-agent: * Allow: /
生成したファイルは、サイトのドメイン直下に robots.txt という名前で設置します(例: https://example.com/robots.txt)。
How to Use the Robots.txt Generator
Build a valid robots.txt file by editing User-agent groups, each with its own Allow/Disallow rules and an optional Crawl-delay. Start from a preset — Allow All, Disallow All, Allow Major Search Engines Only, or Block AI Crawlers — then fine-tune the rules, add one or more Sitemap URLs, and copy or download the result. Everything updates live as you edit.
Features
- Multiple User-agent groups, each with unlimited Allow/Disallow rules
- Presets: allow all, disallow all, major search engines only, and block AI crawlers
- Autocomplete suggestions for well-known crawler user-agent strings
- Optional Crawl-delay per group and multiple Sitemap URLs
- Copy to clipboard or download as
robots.txt, entirely client-side
Robots.txt Generatorの使い方
プリセット(全て許可・全て禁止・主要クローラのみ許可・AIクローラーを拒否)から近い設定を選ぶか、 「+ User-agentグループを追加」から手動で作成します。各グループにはUser-agent名(*で全クローラー対象)と、 Allow/Disallowルールを複数追加できます。Sitemap欄にサイトマップのURLを追加し、右側の生成結果を コピーまたはダウンロードして、サイトのルートに robots.txt として設置してください。
AIクローラー対策について
GPTBot(OpenAI)・ClaudeBot(Anthropic)・Google-Extended(Google AI学習用)・CCBot(Common Crawl) など、生成AIの学習データ収集を行うクローラーは検索エンジンのクローラーとは別のUser-agent名を 持っています。「AIクローラーを拒否」プリセットは、通常の検索エンジンによるクロールは許可したまま、 主要なAIクローラーのみをDisallow: /で拒否する設定を一括生成します。ただしrobots.txtはあくまで 自己申告のプロトコルであり、全てのクローラーが従うとは限らない点にご注意ください。
よくある落とし穴と対処 / Common Pitfalls
| 落とし穴 / Pitfall | 問題 / Problem | 対処 / Fix |
|---|---|---|
| Disallowだけで検索結果から消えると誤解する Assuming Disallow removes a page from search results | Disallowはクロール禁止であり、インデックス除外ではない。外部リンクがあればURLだけ表示され得る Disallow blocks crawling, not indexing; the URL can still appear via external links | 確実に除外したいページはnoindexメタタグ/X-Robots-Tagを使い、そのページ自体はcrawl可能にする Use noindex (and keep the page crawlable so the tag is seen), not Disallow |
| ステージング用の「Disallow: /」を本番に残す Leaving a staging site's blanket "Disallow: /" on production | サイト全体がクロールされなくなり、検索流入が激減する典型的な事故 A classic SEO disaster: the entire site becomes uncrawlable | 本番公開前に必ずrobots.txtの内容を確認する(Search Consoleのrobots.txtレポートも活用) Always verify robots.txt before going live; check Search Console's report |
| パスの大文字小文字やワイルドカード対応を過信する Assuming case-insensitivity or universal wildcard support | パスは大文字小文字を区別し、*や$のワイルドカードはクローラーによって対応状況が異なる Paths are case-sensitive; wildcard (* and $) support varies by crawler | Googlebot以外への配慮が必要な場合は、ワイルドカードに頼らず明示的なパスを列挙する Enumerate explicit paths when targeting crawlers with uncertain wildcard support |
| Crawl-delayでGoogleのクロール頻度を制御しようとする Trying to throttle Googlebot with Crawl-delay | GoogleはCrawl-delayディレクティブを無視する(Bing/Yandexなどは対応) Google ignores Crawl-delay; Bing and Yandex support it | Googleのクロール頻度調整はSearch Console側の設定を使う Use Search Console's crawl rate settings for Google instead |
| robots.txtをサブディレクトリに置く Placing robots.txt in a subdirectory | ドメイン直下(ルート)以外に置いても認識されない。サブドメインごとに別ファイルが必要 It is only recognized at the domain root; each subdomain needs its own file | https://example.com/robots.txt のように必ずルートに設置する Always deploy it at the root, e.g. https://example.com/robots.txt |
| robots.txtに管理画面パスなどを書いて安心してしまう Listing admin paths in Disallow as if that hides them | robots.txtは誰でも閲覧できる公開ファイルで、逆に隠したいパスの存在を教えてしまう robots.txt is publicly readable — Disallow entries reveal the paths you want hidden | 本当に隠したいパスは認証やアクセス制限で保護し、robots.txtに頼らない Protect sensitive paths with authentication, not robots.txt |
言語別コード例 / Code Examples
Next.js (App Router)
// app/robots.ts
import type { MetadataRoute } from "next";
export default function robots(): MetadataRoute.Robots {
return {
rules: [
{ userAgent: "*", allow: "/", disallow: "/admin/" },
{ userAgent: "GPTBot", disallow: "/" },
],
sitemap: "https://example.com/sitemap.xml",
};
}Express.js
app.get("/robots.txt", (req, res) => {
res.type("text/plain");
res.send(
"User-agent: *\nDisallow: /admin/\n\nSitemap: https://example.com/sitemap.xml"
);
});Nginx(静的ファイル配信)
# robots.txtをpublic/直下に置くだけで配信されることが多いが、
# 明示的にContent-Typeを指定したい場合:
location = /robots.txt {
add_header Content-Type text/plain;
}生成例 / Example Output
User-agent: Googlebot
Allow: /
User-agent: Bingbot
Allow: /
User-agent: *
Disallow: /
Sitemap: https://example.com/sitemap.xmlWhy browser-only?
A robots.txt draft can reveal admin panels, staging paths, or internal tooling URLs before you are ready to publish them. This generator assembles the file entirely in your browser from the groups and rules you enter — nothing is uploaded, and it keeps working offline. Open the DevTools Network tab while editing: it stays empty.
robots.txtの下書きには、管理画面や社内ツールなど公開前のパスが含まれることがあります。 本ツールはグループ・ルールの組み立てからファイル生成まで全てブラウザ内で完結し、 入力内容が外部送信されることはありません。
関連ツール / Related Tools
開発をもっと効率的に
PR