mcpField
L
local-schema

local-schema

github.com/garrettjsmith营销与增长13696 次安装11 周前更新
代码仓库

关于 local-schema

local-schema 是面向本地企业 SEO 从业者的结构化数据实施技能,指导配置与 Google Business Profile 数据一致的 LocalBusiness schema。它还涵盖多地点及服务区域企业的标记和验证。

主要功能

  1. 01选择具体的 LocalBusiness 类型
  2. 02配置单地点企业结构化数据
  3. 03为多个地点设置独立标识
  4. 04为无公开地址企业设置服务区域
  5. 05验证标记并排查常见错误

适用场景

  1. 01为本地企业网站添加 LocalBusiness 标记
  2. 02为每个营业地点配置独立 schema
  3. 03检查结构化数据是否与 GBP 信息一致

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/garrettjsmith/localseoskills --skill local-schema

安装后在 Claude Code 中输入/local-schema确认已加载。

详细介绍

本地 Schema 标记

你是实施本地商家结构化数据的专家。你的目标是正确实施 LocalBusiness schema,强化 GBP 数据并提升本地搜索曝光度。

核心原则

你网站上的 Schema 必须与 GBP 数据完全一致。不一致会产生相互冲突的信号。Schema 是你的网站对 GBP 中商家信息的确认。


LocalBusiness Schema 模板

{
  "@context": "https://schema.org",
  "@type": "Plumber",
  "@id": "https://example.com/#business",
  "name": "Smith Plumbing",
  "image": "https://example.com/images/logo.png",
  "url": "https://example.com",
  "telephone": "+17165550100",
  "email": "[email protected]",
  "address": {
    "@type": "PostalAddress",
    "streetAddress": "123 Main St, Suite 200",
    "addressLocality": "Buffalo",
    "addressRegion": "NY",
    "postalCode": "14201",
    "addressCountry": "US"
  },
  "geo": {
    "@type": "GeoCoordinates",
    "latitude": "42.8864",
    "longitude": "-78.8784"
  },
  "openingHoursSpecification": [
    {
      "@type": "OpeningHoursSpecification",
      "dayOfWeek": ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday"],
      "opens": "08:00",
      "closes": "17:00"
    }
  ],
  "areaServed": [
    { "@type": "City", "name": "Buffalo", "sameAs": "https://en.wikipedia.org/wiki/Buffalo,_New_York" },
    { "@type": "City", "name": "Orchard Park" },
    { "@type": "City", "name": "Hamburg" }
  ],
  "priceRange": "$$",
  "sameAs": [
    "https://www.facebook.com/smithplumbing",
    "https://www.yelp.com/biz/smith-plumbing-buffalo"
  ],
  "aggregateRating": {
    "@type": "AggregateRating",
    "ratingValue": "4.8",
    "reviewCount": "142"
  },
  "hasOfferCatalog": {
    "@type": "OfferCatalog",
    "name": "Plumbing Services",
    "itemListElement": [
      {
        "@type": "Offer",
        "itemOffered": {
          "@type": "Service",
          "name": "Emergency Plumbing",
          "description": "24/7 emergency plumbing repair"
        }
      }
    ]
  }
}

@type 选择

使用最具体的 LocalBusiness 子类型:

商家类型Schema @type
普通商家LocalBusiness
水管工Plumber
电工Electrician
HVACHVACBusiness
牙医Dentist
餐厅Restaurant
汽车维修AutoRepair
律师Attorney
房地产经纪人RealEstateAgent
美发沙龙HairSalon
医疗机构MedicalBusiness

完整列表:https://schema.org/LocalBusiness(查看子类型)


多地点 Schema

每个地点都需要使用唯一的 @id 设置自己的 Schema:

{
  "@type": "Plumber",
  "@id": "https://example.com/locations/buffalo-ny/#business",
  "name": "Smith Plumbing - Buffalo",
  "url": "https://example.com/locations/buffalo-ny/",
  ...
}

在首页引用所有地点:

{
  "@type": "Organization",
  "@id": "https://example.com/#organization",
  "name": "Smith Plumbing",
  "department": [
    { "@id": "https://example.com/locations/buffalo-ny/#business" },
    { "@id": "https://example.com/locations/orchard-park-ny/#business" }
  ]
}

SAB(服务区域商家)Schema

对于没有公开地址的商家,省略 address 并着重设置 areaServed:

{
  "@type": "Plumber",
  "name": "Smith Plumbing",
  "areaServed": [
    { "@type": "City", "name": "Buffalo, NY" },
    { "@type": "City", "name": "Orchard Park, NY" },
    { "@type": "State", "name": "New York" }
  ],
  "telephone": "+17165550100",
  "url": "https://example.com"
}

验证

工具
  1. Google Rich Results Test:https://search.google.com/test/rich-results(可渲染 JavaScript)
  2. Schema Markup Validator:https://validator.schema.org/
  3. 浏览器 DevTools:document.querySelectorAll('script[type="application/ld+json"]')
常见错误
  • address 格式与 GBP 不一致
  • 缺少 geo 坐标
  • @type 错误(过于宽泛)
  • telephone 缺少国家区号
  • openingHoursSpecification 与实际营业时间不一致
  • 不同页面使用了重复的 @id

⚠️ 检测限制:web_fetch 和 curl 会移除 <script> 标签。许多 CMS 插件通过 JavaScript 注入 JSON-LD。请务必使用 Rich Results Test 或浏览器工具验证 Schema 是否存在。


针对具体任务的问题

  1. 单个地点还是多个地点?
  2. 有门店还是 SAB?
  3. 使用什么 CMS/平台?(WordPress 插件、Next.js 等)
  4. 商家是否已有 Schema?
  5. 设置了哪些 GBP 类别?

下一步

发现的问题下一步操作技能
已实施 Schema,需要确认是否与 GBP 匹配审核 GBP,确保所有数据与 Schema 完全一致gbp-optimization
需要在多个地点页面添加 Schema根据各页面的地点专属数据构建 Schemalocal-landing-pages
Schema 是更广泛审核的一部分将 Schema 调查结果纳入完整审核报告local-seo-audit
添加了 Schema,但排名没有变化Schema 本身很少能提升排名,它的作用是强化其他信号。请检查问题是否出在其他方面geogrid-analysis

**默认下一步:**实施 Schema 后,使用 Google Rich Results Test 进行验证,然后在接下来的 2 周内监控 Search Console 中的结构化数据错误。

此技能的工具

请参阅 docs/tool-routing,根据已连接的工具进行选择。

  • 大规模 Schema 验证(涵盖多个地点页面)→ 技术审核工具(首选 Screaming Frog 进行自定义提取)
  • 单页验证 → Google Rich Results Test(无需工具技能)

评论

支持 Markdown