应使用 https://schema.org/article 或 https://schema.org/newsarticle,二者均支持 datepublished;需配合 itemscope 使用,并在 time 标签中用 itemprop="datepublished" 与符合 iso 8601 的 datetime 属性共同声明发布时间。

itemtype 应该指向 Schema.org 的哪个类型
描述文章发布时间,itemtype 不能随便写个 URL,必须指向 Schema.org 中定义的、支持 datePublished 属性的类型。最常用且语义最准确的是 https://schema.org/NewsArticle(适用于新闻类)或更通用的 https://schema.org/Article。别用 WebPage 或 Thing —— 它们不原生支持 datePublished,搜索引擎可能忽略该时间字段。
必须配合 itemscope 和 itemprop 才能生效
itemtype 单独存在毫无意义。它必须和 itemscope 成对出现,并在内部用 itemprop="datePublished" 标记具体的时间元素。常见错误是只加 itemtype 却漏掉 itemscope,或者把 itemprop 放在 scope 外面。
正确结构示例:
使用 PptxGenJS 和 Python 解析,将结构化的 HTML/CSS 幻灯片内容转换为原生、可编辑的 PowerPoint(.pptx)演示文稿。
<article itemscope itemtype="https://schema.org/Article"><h1>我的技术笔记</h1> <time itemprop="datePublished" datetime="2024-05-12T09:30:00+08:00">2024年5月12日</time></article>
datetime 属性格式不对会导致解析失败
搜索引擎(如 Google)对 datetime 值校验严格:itemprop="datePublished" 对应的 <time></time> 标签必须带 datetime 属性,且格式需符合 ISO 8601。常见翻车点:
- 写成
datetime="2024-05-12"(缺少时间部分)—— 可接受,但推荐补全时区 - 写成
datetime="2024/05/12"或datetime="12-05-2024"—— 无效,会被忽略 - 没写
datetime,只靠文本内容“2024年5月12日” —— 无法被结构化数据工具识别
Article 和 NewsArticle 的实际区别在哪
两者都支持 datePublished,但 Google 搜索结果中对 NewsArticle 有特殊富媒体展示(如“Top stories”轮播),而普通 Article 更适合博客、文档、教程等非时效性内容。如果你的文章不追求新闻流曝光,用 https://schema.org/Article 更稳妥;误标为 NewsArticle 可能被 Google 判定为误导性标记,长期影响富媒体展现。
另外注意:Schema.org 已废弃旧版 http://schema.org/...(HTTP 协议),必须用 https:// 开头,否则某些验证工具会报错。
前端入门到VUE实战笔记:立即使用
在学习笔记中,你将探索 前端 的入门与实战技巧!










