WordPress Schema Markup for Google Rich Snippets

当人们在谷歌搜索内容时,大多数结果看起来都是一样的:一个蓝色链接、一个 URL 和两行文本。但有些结果与众不同——它们有星级评分、直接在搜索中展开的常见问题下拉框、分步说明、面包屑导航或活动日期。这些增强的列表被称为富样式摘要,它们来自一项称为 Schema 标记的技术。

向你的 WordPress 网站添加 Schema 标记是你可以进行的最具影响力的页面 SEO 改进之一。研究一致表明,与标准蓝色链接结果相比,富样式摘要可将点击率 (CTR) 提高 20–30%——即使你在排名中的位置相同。本指南涵盖所有内容:Schema 是什么、哪些类型最重要、如何使用插件或不使用插件在 WordPress 中实现它们,以及如何正确测试它们。

主要好处:Schema 标记不会直接提高你的谷歌排名——但它会使你的列表更加可见和可点击,从而在不改变排名的情况下为你带来更多有机流量。

1. Schema 标记是什么?

Schema 标记(也称为结构化数据)是在 schema.org 上定义的标签词汇表——这是由谷歌、必应、雅虎和 Yandex 创建的项目。你在 HTML 中嵌入这些标签来标记你的内容含义。谷歌读取这些标签并使用它们在搜索结果中生成富样式摘要。

有三种格式:JSON-LD、Microdata 和 RDFa。谷歌强烈推荐 JSON-LD,因为它放在 <head> 中的 <script> 标签内,完全不需要修改你可见的 HTML。本指南中的每个实现示例都使用 JSON-LD。

JSON-LD Schema 的外观

一个简单的 Article schema 看起来像这样:

<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "Article",
  "headline": "My Article Title",
  "datePublished": "2026-06-12",
  "author": {
    "@type": "Organization",
    "name": "AsiaGB"
  }
}
</script>

这告诉谷歌:"这个页面是一篇文章,由这位作者在这个日期发布。"谷歌可以随后调整搜索结果的样式,在标题旁边显示发布日期。

2. WordPress 网站最有价值的 Schema 类型

Schema.org 拥有超过 800 种类型,但大多数 WordPress 网站只需要五种就能看到可衡量的 SEO 好处:

Schema 类型 谷歌富样式结果 最适合
FAQPage直接在 SERP 中展开的问答常见问题部分,支持文章
Article结果中的日期、作者、图像博客文章、新闻文章
BreadcrumbList页面标题下的类别路径所有带有类别的页面
Product + Review星级评分、价格、可用性电子商务、产品评论
HowToSERP 中的分步编号列表教程/指南文章

3. FAQPage Schema — 影响力最大的类型

FAQPage schema 通常是 WordPress 网站中影响力最大的类型。正确实施时,你的常见问题部分会在谷歌搜索中直接显示为可展开的问答 — 你的列表可以占据标准结果的两到四倍的垂直空间,用户甚至在点击之前就能看到你的答案。

何时使用 FAQPage Schema

FAQPage JSON-LD 示例

<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "FAQPage",
  "mainEntity": [
    {
      "@type": "Question",
      "name": "什么是网络托管?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "网络托管是一种服务,将你的网站文件存储在连接到互联网的服务器上,以便人们可以访问你的网站。"
      }
    },
    {
      "@type": "Question",
      "name": "托管成本是多少?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "共享托管通常从 500 泰铢/年开始。
                 VPS 托管大约从 500 泰铢/月开始。"
      }
    }
  ]
}
</script>

重要提示:FAQPage schema 中的每个问题和答案都必须在页面上可见。如果你为未显示的内容添加 schema,谷歌可能会因结构化数据垃圾邮件而惩罚你的网站。

4. BreadcrumbList Schema — 面包屑列表架构

BreadcrumbList schema 告诉谷歌页面的分层路径 — 例如:首页 › 博客 › WordPress › 文章标题。谷歌在搜索结果中 URL 下方显示这个路径,用人类可读的导航替换原始 URL。这提高了清晰度,通常会增加点击率,因为用户确切知道页面在你网站中的位置。

<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "BreadcrumbList",
  "itemListElement": [
    {
      "@type": "ListItem",
      "position": 1,
      "name": "首页",
      "item": "https://yoursite.com/"
    },
    {
      "@type": "ListItem",
      "position": 2,
      "name": "博客",
      "item": "https://yoursite.com/blog/"
    },
    {
      "@type": "ListItem",
      "position": 3,
      "name": "文章标题",
      "item": "https://yoursite.com/blog/article-slug/"
    }
  ]
}
</script>

5. 博客文章的 Article Schema

Article schema 对博客文章、新闻文章和指南至关重要。它帮助谷歌理解发布日期、作者身份和图像 — 这些可能会在搜索结果中显示。Article schema 也是你的内容出现在谷歌发现和谷歌新闻中的必需条件。

最重要的 Article JSON-LD 字段

提示:每当你大幅修改文章时,始终更新 dateModified。谷歌使用此日期来确定内容新鲜度,这可能会影响"最佳 WordPress 插件 2026"等时间敏感查询的排名。

6. How to Add Schema Markup in WordPress — Three Methods

Method 1: Using Yoast SEO (Recommended for Most Sites)

Yoast SEO (free) automatically generates Article, BreadcrumbList, WebPage, and Organization schema for every page and post. You do not need to write any JSON-LD manually.

Method 2: Using Rank Math SEO

Rank Math SEO includes a Schema module with built-in support for over 20 schema types. Notably, it adds FAQPage and HowTo schema directly as Gutenberg blocks — you add a "FAQ" block in your post editor and the schema is generated automatically from your block content.

Method 3: Manual JSON-LD via functions.php

For developers or sites where plugins are not an option, you can inject JSON-LD manually via your child theme's functions.php:

// Add FAQPage schema to a specific page
add_action('wp_head', function() {
    if (is_page('faq')) {
        echo '<script type="application/ld+json">' . json_encode([
            '@context' => 'https://schema.org',
            '@type' => 'FAQPage',
            'mainEntity' => [
                [
                    '@type' => 'Question',
                    'name' => 'What is your return policy?',
                    'acceptedAnswer' => [
                        '@type' => 'Answer',
                        'text' => 'We offer a 30-day money-back guarantee.'
                    ]
                ]
            ]
        ], JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT) . '</script>';
    }
});

Always use JSON_UNESCAPED_UNICODE if your content includes non-ASCII characters (Thai, Japanese, accented letters) to avoid encoding issues.

7. Product and Review Schema for WooCommerce

If you run a WooCommerce store, Product schema is one of the most powerful rich result types. It displays price, availability, and star ratings directly in Google Shopping and organic results. WooCommerce itself generates basic Product schema out of the box, but you can enhance it:

8. HowTo Schema for Tutorial Articles

HowTo schema is ideal for articles structured as numbered steps — guides like "How to Install WordPress," "How to Set Up SSL," or "How to Optimize Images." When Google recognizes your article as a HowTo, it may display the step numbers and tools list directly in search results.

<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "HowTo",
  "name": "How to Install a WordPress Plugin",
  "step": [
    {
      "@type": "HowToStep",
      "position": "1",
      "name": "Log into WordPress Admin",
      "text": "Navigate to yoursite.com/wp-admin and log in with your credentials."
    },
    {
      "@type": "HowToStep",
      "position": "2",
      "name": "Go to Plugins",
      "text": "Click Plugins in the left sidebar, then click Add New."
    },
    {
      "@type": "HowToStep",
      "position": "3",
      "name": "Search and Install",
      "text": "Search for the plugin name, click Install Now, then Activate."
    }
  ]
}
</script>

9. Organization and WebSite Schema — Global Site Schema

Two schema types should appear on your homepage (and only your homepage) as site-wide signals:

Organization Schema

Organization schema tells Google about your business — name, logo, contact information, and social media profiles. This data can appear in the Knowledge Panel on the right side of search results when users search for your brand name directly.

WebSite Schema with Sitelinks Searchbox

WebSite schema with a SearchAction property can enable a Sitelinks Searchbox — a search input that appears under your brand result, letting users search your site directly from Google. Add it to your homepage only:

{
  "@context": "https://schema.org",
  "@type": "WebSite",
  "name": "Your Site Name",
  "url": "https://yoursite.com/",
  "potentialAction": {
    "@type": "SearchAction",
    "target": {
      "@type": "EntryPoint",
      "urlTemplate": "https://yoursite.com/?s={search_term_string}"
    },
    "query-input": "required name=search_term_string"
  }
}

10. Testing Your Schema Markup

After implementing any schema, always test before publishing. Google provides two official tools:

Google Rich Results Test

Visit search.google.com/test/rich-results, paste your page URL, and Google will show:

Google Search Console — Enhancements Report

After Google crawls your pages, the Search Console Enhancements section shows:

Allow 3–7 days after publishing new schema for Google to crawl and process your pages. Rich Snippets do not appear instantly.

11. Common Schema Markup Mistakes to Avoid

Mistake Consequence Fix
Schema not matching visible contentManual spam penaltyAlways mirror what is visible on the page
Multiple FAQPage schemas on same pageOnly first block is parsedCombine all Q&As into one FAQPage schema
Missing required fields (e.g. no image in Article)Rich result ineligibleAdd all required fields listed by Google
Invalid JSON (unclosed quotes, trailing commas)Schema completely ignoredValidate JSON at jsonlint.com
Promotional language in Review schemaIneligible for star displayReviews must be from genuine users, not site owner

12. Schema Markup Checklist for WordPress

Task Status
Install Yoast SEO or Rank Math for automatic schema☐
Configure Organization (name, logo, social links)☐
Enable Breadcrumbs and add PHP snippet to theme☐
Add FAQPage schema to pages with FAQ sections☐
Add HowTo schema to tutorial/guide articles☐
Add Product + AggregateRating for WooCommerce (if applicable)☐
Test every schema type using Rich Results Test☐
Monitor Enhancements report in Google Search Console☐

Bottom line: FAQPage and BreadcrumbList schema deliver the fastest, most visible returns for most WordPress sites. Start there, test with the Rich Results Test, then expand to HowTo and Product schema as needed. The entire process takes under an hour with a plugin like Yoast or Rank Math.

Fast WordPress Hosting with Free SSL & DirectAdmin

AsiaGB Hosting includes a free SSL certificate, DirectAdmin control panel, one-click WordPress install, and 99% uptime SLA — starting at just ฿500/year.

View Hosting Plans →