カスタムrobots.txtを有効にする

Blogger では直接 robots.txt ファイルを編集することはできませんが、カスタム robots.txt 機能を有効にすることで、既存の robots.txt ファイルの内容を任意の値に変更することができます。ここでは Blogger でカスタム robots.txt を有効にする方法について解説します。

(Last modified: )

カスタムrobots.txtを有効にする

カスタム robots.txt を有効にするには、管理画面左側に表示されている「設定」をクリックしてください。

カスタムrobots.txtを有効にする(1)

「設定」画面が表示されます。

カスタムrobots.txtを有効にする(2)

「クローラとインデックス」のブロックの「カスタム robots.txt を有効にする」がデフォルトでは無効となっています。有効にするには右側に表示されているスイッチをクリックして有効にしてください。

カスタムrobots.txtを有効にする(3)

カスタムrobots.txtを有効にする(4)

カスタム robots.txt が有効になりました。

それでは robots.txt に記述を追加してみます。「カスタム robots.txt」と表示されている箇所をクリックしてください。

カスタムrobots.txtを有効にする(5)

robots.txt に追加する設定を記述する画面が表示されます。

カスタムrobots.txtを有効にする(6)

今回は例として次のような記述を追加しました。記述が終わりましたら「保存」をクリックしてください。

User-agent: *
Disallow: /search
Allow: /

User-agent: googlebot
Disallow: /2022/06/blog-post.html

カスタムrobots.txtを有効にする(7)

robots.txt ファイルの内容が先ほど入力さした内容に書き換えられました。

カスタムrobots.txtを有効にする(8)

ではカスタム robots.txt を有効にする前と有効にしたあとで robots.txt ファイルがどのように変わったのか確認してみます。

有効にする前:

User-agent: Mediapartners-Google
Disallow: 

User-agent: *
Disallow: /search
Allow: /

Sitemap: https://sanponokiroku.blogspot.com/sitemap.xml

カスタムrobots.txtを有効にする(9)

有効にしたあと:

User-agent: *
Disallow: /search
Allow: /

User-agent: googlebot
Disallow: /2022/06/blog-post.html

カスタムrobots.txtを有効にする(10)

robots.txt ファイルの内容が先ほど入力した内容に置き換わっているのが確認できました。

-- --

Blogger でカスタム robots.txt を有効にする方法について解説しました。

( Written by Tatsuo Ikura )

Profile
profile_img

著者 / TATSUO IKURA

プログラミングや開発環境構築の解説サイトを運営しています。