0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

よくある質問の構造化マークアップについて

Posted at

よくある質問の構造化マークアップについて

クローラーにwebサイトの内容を適切に理解してもらえるようなよくある質問の構造化マークアップについて、恥ずかしながら最近まで知らずにコーディングをしてしまっていたので改めて調べてみました。

追加する属性

FAQ全体や質問、回答を表す要素に属性を付与する必要があります。属性を与える部分は以下の5つの要素になります。

対象 追加する属性
FAQ全体 itemscope itemtype="https://schema.org/FAQPage"
各FAQ itemscope itemprop="mainEntity" itemtype="https://schema.org/Question"
質問文 itemprop="name"
回答全体 itemscope itemprop="acceptedAnswer" itemtype="https://schema.org/Answer"
回答文 itemprop="text"

具体例

以下は実際に上記属性を追加したFAQの具体例です。

index.html
<ul itemscope itemtype="https://schema.org/FAQPage">
  <li itemscope itemprop="mainEntity" itemtype="https://schema.org/Question">
    <div itemprop="name">質問 内容</div>
    <div itemscope itemprop="acceptedAnswer" itemtype="https://schema.org/Answer">
      <p itemprop="text">回答 内容</p>
    </div>
  </li>
</ul>
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?