如何为网站FAQ板块的HTML代码添加标准Schema Markup
为FAQ板块HTML代码添加Schema结构化数据标记
以下是添加了标准FAQPage Schema标记后的完整HTML代码(已翻译为中文):
<div class="ts-faq-accordion-content" itemscope itemtype="https://schema.org/FAQPage"> <div class="ts-faq-accordion-item" itemprop="mainEntity" itemscope itemtype="https://schema.org/Question"> <div class="ts-faq-item-header"> <h4 class="ts-faq-item-question" itemprop="name"> 如何为FAQ的HTML代码添加Schema标记? </h4> <div class="ts-faq-item-icon"> <i class="down-icon"></i> </div> </div> <div class="ts-faq-item-content" itemprop="acceptedAnswer" itemscope itemtype="https://schema.org/Answer"> <p class="ts-faq-item-answer" itemprop="text"> 你的内容符合Google的FAQPage规范要求。要启用富文本结果,你需要遵循Google制定的相关规范。 </p> </div> </div> </div>
关键标记说明:
- 最外层容器添加
itemscope itemtype="https://schema.org/FAQPage",声明这是一个FAQ页面结构 - 每个问答项容器添加
itemprop="mainEntity" itemscope itemtype="https://schema.org/Question",标记这是一个具体的问题条目 - 问题标题元素添加
itemprop="name",指定这是问题的名称 - 回答容器添加
itemprop="acceptedAnswer" itemscope itemtype="https://schema.org/Answer",标记这是该问题的已接受答案 - 回答内容元素添加
itemprop="text",指定这是答案的文本内容
内容的提问来源于stack exchange,提问作者omid
相关产品推荐
相关产品推荐

