2026年6月25日木曜日

Google に対してある特定のスニペットを検索結果に表示しないように指示する

HTML ページのテキスト部分をスニペットとして使用しないように指定できます。これは、span 要素、div 要素、section 要素の data-nosnippet HTML 属性を使用して、HTML 要素レベルで行えます。data-nosnippet は論理属性とみなされます。すべての論理属性と同様、指定された値は無視されます。マシンによる解釈が確実に行われるように、HTML によるセクションの記述が正しく、すべてのタグが適切に閉じられていることを確認してください。

Robots meta タグ、data-nosnippet、X-Robots-Tag の設定 | Google 検索セントラル  |  Documentation  |  Google for Developers
https://developers.google.com/search/docs/crawling-indexing/robots-meta-tag?hl=ja#data-nosnippet-attr

<p>This text can be shown in a snippet
<span data-nosnippet>and this part would not be shown</span>.</p>

<div data-nosnippet>not in snippet</div>
<div data-nosnippet="true">also not in snippet</div>
<div data-nosnippet="false">also not in snippet</div>
<!-- all values are ignored -->

<div data-nosnippet>some text</html>
<!-- unclosed "div" will include all content afterwards -->

<mytag data-nosnippet>some text</mytag>
<!-- NOT VALID: not a span, div, or section -->

<p>This text can be shown in a snippet.</p>
<div data-nosnippet>
<p>However, this is not in snippet.</p>
<ul>
  <li>Stuff not in snippet</li>
  <li>More stuff not in snippet</li>
</ul>
</div>

HTML 要素レベルで行える検索避け

F(uriouz)

欲しいものリスト / 優先度の高いほしいものリスト / ☕を奢る
Donate 寄付 カンパ サポート Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation.
詳細プロフィールを表示

0 comments:

スパム対策の為コメントをオフにしています。
Disqusは利用出来ます。

注: コメントを投稿できるのは、このブログのメンバーだけです。

...

Recent Posts

 
"The Android robot is reproduced or modified from work created and shared by Google and used according to terms described in the Creative Commons 3.0 Attribution License."