在尝试schema.org/Article
针对Google的结构化数据测试工具验证时,我注意到如果您指定SVG图像,则会出错:
为徽标提供的值必须是有效的URL.
要求:
AMP文章(这是什么?)
当URL被改变为具有一个.png
(或.jpg
,.bmp
,.webp
等)延伸,而不是.svg
,它通过验证.
这是我正在使用的示例:
<div itemscope itemtype="http://schema.org/Article">
<div itemprop="publisher" itemscope itemtype="https://schema.org/Organization">
<meta itemprop="name" content="Example" />
<meta itemprop="url" content="http://example.com" />
<div itemprop="logo" itemscope itemtype="https://schema.org/ImageObject">
<meta itemprop="url" content="http://example.com/logo.svg" />
<meta itemprop="width" content="600" />
<meta itemprop="height" content="60" />
</div>
</div>
<meta itemprop="dateModified" content="2016-01-05T12:43" />
<meta itemprop="datePublished" content="2016-01-05T12:43" />
<meta itemprop="headline" content="Example" />
<meta itemprop="name" content="Example" />
<meta itemprop="author" content="Example" />
<link itemprop="mainEntityOfPage" href="http://example.com/article" …
Run Code Online (Sandbox Code Playgroud) 使用这些但它没有验证:
<div itemscope itemtype="http://schema.org/Product">
<h1 itemprop="name">Product</h1>
<span itemprop="description">Product
<div itemprop="offers" itemscope itemtype="http://schema.org/Offer">
Prices start at <meta itemprop="priceCurrency" content="PHP" />Php
<span itemprop="price">1799.00 (monthly)
</div>
</div>
Run Code Online (Sandbox Code Playgroud) 我按照schema.org上的说明在他们的网站上添加公司的营业时间,但是,W3C的HTML验证器不喜欢它> _ <它给了我以下错误:
元素时间属性datetime的错误值Mo-Fr 09:00-19:00:文字不满足time-datetime格式.
以下是我的HTML:
<div>
<p>Office Hours:</p>
<p><time itemprop="openingHours" datetime="Mo-Fr 09:00-19:00">Monday-Friday: 9:00 am to 7:00 pm</time></p>
<p><time itemprop="openingHours" datetime="Sa 10:00-17:00">Saturdays: 10:00 am to 5:00 pm</time></p>
<p><time itemprop="openingHours" datetime="Su 11:00-16:00">Sundays: 11:00 am to 4:00 pm</time></p>
</div>
Run Code Online (Sandbox Code Playgroud)
我究竟做错了什么?
JSON-LD
脚本Rich Card
展示在SERP
尝试创建用户定义的变量以及标签本身使用的脚本时。使用GTM的预览和调试功能时。我收到以下错误:
此语言功能仅支持 ECMASCRIPT6 模式或更好的模式:让声明。使用 --language_in=ECMASCRIPT6 或 ECMASCRIPT6_STRICT 启用 ES6 功能。
我明白……或者至少我认为我明白我需要告诉编译器
使用 --language_in=ECMASCRIPT6 或 ECMASCRIPT6_STRICT
但是我如何做到这一点?
<script>
(function(){
// ==ClosureCompiler==
// @compilation_level SIMPLE_OPTIMIZATIONS
// @output_file_name default.js
// @language_in=ECMASCRIPT6_STRICT;
// @language_out=ES5_STRICT;
// ==/ClosureCompiler==
"use strict";
let data = {
"@context": "http://schema.org",
"@type": "MovingCompany",
"name": "WDA Movers",
"logo" : {
"@type" : "ImageObject",
"url" : "http://wda-moving.online/images/logo.jpg",
"height" : 435,
"width" : …
Run Code Online (Sandbox Code Playgroud) compiler-errors google-tag-manager ecmascript-6 json-ld google-rich-snippets
我想在Google搜索中添加公司联系人.我在Google的结构化数据测试工具中测试了以下代码,但它抛出了这个错误:
https://coda-resume.herokuapp.com/
(提供的所有值http://www.example.com/
必须具有相同的域.)
这是JSON-LD:
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "Organization",
"url": "https://coda-resume.herokuapp.com/",
"logo": "http://www.example.com/logo.png",
"contactPoint": [{
"@type": "ContactPoint",
"telephone": "+1-401-555-1212",
"contactType": "customer service"
}]
}
</script>
Run Code Online (Sandbox Code Playgroud)
(我把它放在head
元素中.)
使用以下 HTML+RDFa:
<div vocab="https://schema.org/" typeof="Service">
<meta property="name" content="My Service Name"/>
<div property="description">
For verified ratings of our services, please view our:
<a
href="https://www.capterra.com/link/to/captera"
target="_blank"
>4.9 Star Rating on Capterra</a>
</div>
<div property="aggregateRating" typeof="AggregateRating">
<div>
Capterra Rating:
<span property="ratingValue">4.9</span> out of
<span property="bestRating">5</span> with
<span property="ratingCount">112</span> ratings
</div>
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
此代码段在我的代码中,但是当我在 Google 的Structured Data Testing Tool 中对其进行测试时,出现以下错误:
我无法接受此错误,因为(如果我在阅读本正确地),根据该Service
文档中https://schema.org/,这是一个支持的属性。我确定某处存在语法错误,或者,如果我敢碰太阳,Google 是错误的。
我通过结构化数据运行它并识别它:
我在这里做错了什么?
我想为网站启用Google Sitelinks Search Box.关键是它的自定义搜索页面是由哈希片段实现的,所以JSON-LD数据片段是这样的:
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "WebSite",
"name" : "my site",
"alternateName" : "example.com",
"url": "http://www.example.com/",
"potentialAction": {
"@type": "SearchAction",
"target": "http://www.example.com/Search/#!/Keyword-{search_term_string}",
"query-input": "required name=search_term_string"
}
}
</script>
Run Code Online (Sandbox Code Playgroud)
当Google尝试从此部分提取信息"required name=search_term_string"
以显示附加链接搜索框时,遇到问题:
: http://schema.org/True
valueName: missing and required
Run Code Online (Sandbox Code Playgroud)
我怀疑Google可能只是期望查询字符串中的搜索字符串而不是散列片段,除了重定向之外你还建议什么?
我正在尝试创建谷歌的结构化数据,但不知道我在做什么。我将其设置为一个组织,然后对我的所有产品使用 SD 标记工具。我将每个 JSON-LD 产品直接从标记工具与嵌套放入其自己的脚本标签中。然后我将其放入服务器上的 .js 文件中。我在我的标题中将其与此链接
<script src="../Scripts/structureddata.js"></script>
Run Code Online (Sandbox Code Playgroud)
我已经使用 url 在 SD 工具中对其进行了测试,但没有看到它。然后我将 StructuredData.js 复制到该工具中,它是这么说的,然后我纠正了它显示我的 50 个产品的所有警告和错误。再次尝试,从 url 中看不到它。我可以在 Search Console 中看到它,它显示 1 个项目。我“假设”阅读它只显示一个......?
谁能帮我这个。我应该把它放在 .js 文件中吗?我可以使用 .js 文件的链接吗?为什么 SD 工具看不到链接文件中的结构化数据?
我有一个 Gatsby 的基本博客设置,在发布此问题时,缺少 SEO 组件的良好文档。有一些基本 SEO 组件的示例,但我想要的是更深入一些。也许,如果在这里达成了解决方案,则可以将其贡献给 Gatsby 文档,让其他人受益。
在通常的标题和描述元标记以及 facebook/twitter 开放图元(我已经完成)之上,我想为丰富的片段添加结构化数据,这些数据将根据博客文章的类型而有所不同。例如,我可能有一个常规帖子会打印文章架构,有些帖子可能是How-to,在这种情况下,我想打印 HowTo 架构而不是文章。在某些时候,我可能会写一篇适合常见问题解答架构的帖子。
我不知道这是否是最好的方法,但这是我的想法:
我也在考虑将架构数据存储在 frontmatter 中,但由于这些数据非常复杂,并且会因帖子类型而异(文章、方法等),我不确定这是否是一个好主意?
---
title: Hello World
description: How to say hello
article: false
how-to: true
faq: false
---
Run Code Online (Sandbox Code Playgroud)
下面是我的整个 SEO 组件,这显然不起作用,但您希望能看到我的想法。我已经剖析并借鉴了gatsby 高级启动组件和gatsby 启动棱镜组件,但都没有完全满足我的需求。这是我的:
import React from "react"
import Helmet from "react-helmet"
import PropTypes from "prop-types"
import { useStaticQuery, graphql } from "gatsby"
import Facebook from …
Run Code Online (Sandbox Code Playgroud) 我将 Schema.org(使用 Microdata)添加到产品页面。我的客户希望省略已售产品的价格 - 她不希望任何人能够看到已售产品的价格。
但是,这在“价格”的微数据中显示为错误:检查 Google SDTT 中的页面
显然普通用户仍然无法看到价格,但它被谷歌购物使用,所以可能会出现。
我应该把价格设为 0 吗?
有没有在谷歌的丰富网页摘要@type的任何完整列表json-ld
,有很多数据类型,其用途Organisation
,listItem
,Recipe
,等
我们希望使用 JSON-LD 格式以FAQPage的形式添加特色片段。使用 Google 页面概述上的“查看标记”链接FAQPage
,我们可以获得下面的示例特色片段。这似乎意味着该页面的所有问题都应该在一个<script>
标签中。
我们通过Google 的结构化数据测试工具和丰富结果工具运行了以下内容,它返回了零错误。然而,没有提到它全部在一个script
标签中。
如果我们要使用FAQPage
特色片段,我们需要使用的正确变体是什么(1 或 2)?
变体 1 - 将所有问题集中在一个script
标签中:
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "FAQPage",
"mainEntity": [{
"@type": "Question",
"name": "What is the return policy?",
"acceptedAnswer": {
"@type": "Answer",
"text": "Most unopened items in new condition and returned within <strong>90 days</strong> will receive a refund or exchange. Some items have a modified return policy noted on the receipt …
Run Code Online (Sandbox Code Playgroud) 在 Google Search Console 上,我收到了缺少最佳和最差评级的错误。但是当我在测试工具上测试链接时,我得到:
未能标准化评级值。
您的评分值超出了默认范围,您必须提供最佳和最差值。
代码如下:
<h3>Reviews</h3>
<div class="average-rating" itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating">
<p class="rating-title">Average Rating</p>
<div class="rating-box">
<div class="average-value" itemprop="ratingValue">0/5</div>
<div class="review-amount" itemprop="ratingCount">0 rating</div>
</div>
Run Code Online (Sandbox Code Playgroud)
当我将评级值更改为
<div class="average-value" itemprop="ratingValue">0/5</div>
Run Code Online (Sandbox Code Playgroud)
或为此
<div class="average-value" itemprop="ratingValue">0/-454545</div>
Run Code Online (Sandbox Code Playgroud)
它发出警告:
0 评分(提供的值
ratingCount
必须是整数。)
我该如何解决这个问题?
schema.org ×8
json-ld ×6
microdata ×3
amp-html ×1
datetime ×1
ecmascript-6 ×1
gatsby ×1
html ×1
html5 ×1
javascript ×1
price ×1
reactjs ×1
schema ×1
svg ×1
types ×1