简体   繁体   English

用于动态创建的搜索结果的Schema.org标签?

[英]Schema.org tags for dynamically created search results?

When adding Schema.org tags to a page, should I include items which are dynamically created - eg a component which only exists on a page after a user has entered a search term? 在将Schema.org标签添加到页面时,我是否应该包含动态创建的项目-例如,在用户输入搜索词后仅存在于页面上的组件?

Or should these tags be reserved solely for static objects that will always be on the page? 还是应该仅将这些标记保留给将始终在页面上的静态对象使用?

Schema.org is used for search engines. Schema.org用于搜索引擎。 So you have to think about which content a search engine has access to. 因此,您必须考虑搜索引擎可以访问哪些内容。

Search engines don't necessarily wait for dynamic content (for example content loaded via Ajax, or after user interaction). 搜索引擎不必等待动态内容(例如,通过Ajax加载的内容,或在用户交互之后的内容)。 So all Schema.org markup added to the page after the initial page load may not have the impact you would like. 因此,在初始页面加载后添加到页面的所有Schema.org标记可能都不会产生您想要的影响。

In your example content is shown after a user enters a search term. 在您的示例中,内容是在用户输入搜索词后显示的。 A search engine would not get to that content, so adding Schema.org there would be of little use. 搜索引擎无法获取该内容,因此添加Schema.org几乎没有用。

Some consumers support JavaScript (so they could make use of the structured data on content that is created on the client-side), some consumers don't support JavaScript (so they can't access that structured data). 一些使用者支持JavaScript(因此他们可以在客户端创建的内容上使用结构化数据),一些使用者不支持JavaScript(因此他们不能访问该结构化数据)。

Consumers could be web services (like search engines), but also user agents and tools (like browser extensions). 消费者可以是Web服务(如搜索引擎),也可以是用户代理和工具(如浏览器扩展)。 As an example, Google supports it only for JSON-LD , but not for Microdata or RDFa. 例如, Google仅支持JSON-LD ,而不支持Microdata或RDFa。

If it's not much work for you, go with it. 如果您的工作量不大,那就去吧。 It can't hurt, but could help. 它不会伤害,但可以有所帮助。 If it's work, you might want to consider which consumers you want to support, and then check their documentation. 如果可行,您可能需要考虑要支持的使用者,然后查看其文档。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如果使用JavaScript动态构建标记,Schema.org标记是否有效? - Does Schema.org markup work if markup is dynamically built with JavaScript? Schema.org本体为json - Schema.org ontology as json 使用jQuery更改schema.org微数据? - Changing schema.org microdata with jQuery? 添加schema.org视频标记以使用Javascript嵌入 - Add schema.org video markup to embed using Javascript 添加所需的Schema.org JSON LD标记 - adding required Schema.org JSON LD Markup 如何使用jQuery(schema.org微格式)查找和读取元数据? - How to find and read metadata using jQuery (schema.org microformat)? 是否有一种简单的方法可以将秒转换为ISO 8601格式以供schema.org视频元数据使用? - Is there an easy way to convert seconds into an ISO 8601 format for use in the schema.org video metadata? 您如何在Google richsnippets测试工具中测试AngularJS Web应用程序的schema.org元标记? - How do you test the schema.org metatags of an AngularJS webapp in Google richsnippets testing tool? 检测是否存在具有属性的标签的最快方法[itemtype ='http://schema.org/Offer'] - Fastest method to detect if there is a tag with attribute [itemtype='http://schema.org/Offer'] 对于 Astro.js,如何访问 ld+json schema.org SEO JSON 中的 frontmatter 变量? - For Astro.js, how to access frontmatter variables in ld+json schema.org SEO JSON?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM