Seo优化 - 网站首页Schema.org 结构化数据标记

安然
,技术教程
,Oct 24, 2025
0

SEO 首页的结构化数据标记

网站首页的Schema结构化数据优化方案,主要包括三部分:

  1. WebSite类型定义网站基本信息;
  2. WebPage类型描述页面属性;
  3. Organization类型展示机构信息。 通过JSON-LD格式实现,包含网站名称、URL、多语言支持、搜索功能、企业logo、社交媒体链接、联系方式等结构化数据,有助于搜索引擎更好地理解网站内容。代码示例展示了如何将这些元素组织成一个完整的@graph数组,使用标准schema.org词汇表进行标注。

Schema.org 结构化数据标记

首页的结构化数据加上Website,Webpage和Organization网站组织信息

 <script type="application/ld+json">
            {
                "@context": "https://schema.org/",
                "@graph": [
                    {
                        "@type": "WebSite",
                        "@id": "https://www.example.com#website",
                        "url": "https://www.example.com",
                        "name": "example",
                        "inLanguage": "en-US",
                        "publisher": {
                            "@id": "https://www.example.com#identity"
                        },
                        "potentialAction": [{
                            "@type": "SearchAction",
                            "target": "https://www.example.com/search?q={search_term_string}",
                            "query-input": "required name=search_term_string"
                        }]
                    }, 
                    {
                        "@type": "WebPage",
                        "@id": "https://www.example.com#webpage",
                        "url": "https://www.example.com",
                        "name": "example",
                        "description": "example",
                        "about": {
                            "@id": "https://www.example.com#identity"
                        },
                        "isPartOf": {
                            "@type": "WebSite",
                            "@id": "https://www.example.com#website"
                        }
                    }, 
                    {
                        "@type": "Organization",
                        "@id": "https://www.example.com#identity",
                        "name": "example",
                        "url": "https://www.example.com",
                        "logo": "https://www.example.com/logo.png",
                        "description": "example",
                        "sameAs": [
                            "https://www.facebook.com/people/example/61566438561692/", 
                            "https://www.instagram.com/example/", 
                            "https://x.com/example", 
                            "https://www.youtube.com/@example", 
                            "https://www.pinterest.com/example/", 
                            "https://discord.gg/example", 
                            "https://www.reddit.com/user/example"
                        ],
                        "contactPoint": [{
                            "@type": "ContactPoint",
                            "telephone": "+1(347)123-4567",
                            "contactType": "customer service",
                            "areaServed": "US",
                            "email": "support@example.com",
                            "url": "https://www.example.com/contact-us.html",
                            "availableLanguage": ["English"]
                        }]
                    }
                ]
            }
    </script>

【关于这段 JSON-LD 结构化数据】

这段代码是用于 SEO 的 Schema.org 结构化数据标记,它告诉搜索引擎:

“这个网站是谁、主页是哪一页、怎么搜索、联系方式在哪”等等~ 它让搜索结果更漂亮(比如带 logo、搜索框、社交链接之类的~)

下面我来分模块讲👇


1. 外层结构

"@context": "https://schema.org/",
"@graph": [ ... ]
  • @context: 告诉搜索引擎这是遵循 Schema.org 的标准语义。
  • @graph: 表示这是一组互相关联的实体对象,可以理解成“一个网站的信息网络”。

2. WebSite(整个网站的信息)

{
  "@type": "WebSite",
  "@id": "https://www.example.com#website",
  "url": "https://www.example.com",
  "name": "example",
  "inLanguage": "en-US",
  "publisher": { "@id": "https://www.example.com#identity" },
  "potentialAction": [{
    "@type": "SearchAction",
    "target": "https://www.example.com/search?q={search_term_string}",
    "query-input": "required name=search_term_string"
  }]
}

功能:

  • 告诉 Google:网站的主域是哪个、语言是什么、谁发布的。
  • SearchAction 会在 Google 搜索结果页中显示一个站内搜索框(很高级的那种搜索条!)

3. WebPage(当前网页的信息)

{
  "@type": "WebPage",
  "@id": "https://www.example.com#webpage",
  "url": "https://www.example.com",
  "name": "example",
  "description": "example",
  "about": { "@id": "https://www.example.com#identity" },
  "isPartOf": { "@id": "https://www.example.com#website" }
}

功能:

  • 描述具体的网页(这里是首页)。
  • isPartOf:说明它属于上面的 WebSite
  • about:说明这个网页是关于哪个组织(Organization)。

4. Organization(网站所属组织)

{
  "@type": "Organization",
  "@id": "https://www.example.com#identity",
  "name": "example",
  "url": "https://www.example.com",
  "logo": "https://www.example.com/logo.png",
  "description": "example",
  "sameAs": [ ... ],
  "contactPoint": [{
    "@type": "ContactPoint",
    "telephone": "+1(347)123-4567",
    "contactType": "customer service",
    "areaServed": "US",
    "email": "support@example.com",
    "url": "https://www.example.com/contact-us.html",
    "availableLanguage": ["English"]
  }]
}

功能:

  • 描述网站背后的公司或品牌。
  • sameAs:告诉搜索引擎哪些社交媒体是官方的(帮助聚合品牌资料)。
  • contactPoint:列出官方联系方式,常被用于显示在“知识面板”中。

总结一下:

模块类型用途
WebSite网站层级定义网站基本信息和站内搜索
WebPage页面层级描述当前网页内容
Organization组织层级品牌、logo、社交账号、联系方式
我的头像

Hi~我是安然 ✨

这是我的小小角落,记录代码、生活和灵感碎片 💻🍃。 我喜欢探索前端的无限可能,也会偶尔写写随笔~ 希望这里能成为我们交流与分享的温暖空间 💖。