Different schema type for Topics and Posts

Continuing the discussion from Invalid Article Schema:

Currently we are using schema type DiscussionForumPosting for every post in a topic. So if a topic having 5 posts totally then in same page we rendering DiscussionForumPosting 5 times.

In this case I think it’s better to use DiscussionForumPosting only once for whole topic and Comment schema type for remaining 4 replies like below.

<div itemscope itemtype="http://schema.org/DiscussionForumPosting">

   <span itemprop="datePublished">10/05/2017</span>
	<span itemprop="headline">Sample Topic Title</span>
	<span itemprop="image">https://meta.discourse.org/image-url9.png</span>
	<div itemprop="articleBody">Topic's First Post Content</div>
    <span itemprop="author">User 1</span>
    
 	<div itemprop="comment" itemscope itemtype="http://schema.org/Comment">
    	<span itemprop="author">User 2</span>
    	<div itemprop="text">Second Post Content</div>
 	</div>
 
 	<div itemprop="comment" itemscope itemtype="http://schema.org/Comment">
    	<span itemprop="author">User 3</span>
    	<div itemprop="text">Third <b>Post</b> Content</div>
 	</div>
 
</div>
3 个赞

Why? What problem does this solve?

2 个赞

It won’t solve any big issue :slight_smile:

Since we are using DiscussionForumPosting schema for every post Google requiring valid image property for all posts. If we used DiscussionForumPosting only once for topic then we can skip this issue. And I guess this is the correct way to do.

1 个赞

Currently i have not seen above schema method in discourse.

Is this method are in work in progress?

I have found one image error in schema testing tool as below.

Also, I want to hide “datePublished” items from google serp. Can anyone guide me how to do that?

No. Currently I am not sure about this change 100%. I’m unable to find any resource that recommending Comment schema type for reply posts.

Not error. It is just a warning. Google recommending the image field if available.

It is a required field.

2 个赞

I am looking to hide published date shown from google search only.

I search “Different schema type for Topics and Posts” on google and found below post.

Discourse%20Date%20Snapshot%202

It is not recommended. You have to override the show.html.erb template file with a plugin to achieve it.

6 个赞

When search “Change the domain name or rename my Discourse?” found the below article but shows the date in google serp search that when article was published 1st time in 2014.

After that there are 7 revision made on that post and last updated date in 09th December 2017.

So is there anyway to set in forum or made any changes for google to pickup “last update date” instead of “date published” ?

Google%20Structured%20Data%20Snapshot%202

I hope everyone understand my doubt. If anyone show tutorial post on google search result but that are showing 4 years backdated then there are less chances to click.

6 个赞

Ah yes, excellent point, we should check the HTML metadata there @vinothkannans to make sure for wiki posts it is using date of last edit and not date of initial posting.

7 个赞

We previously only used created_at date in datePublished schema property. Now if a post is updated then the updated_at date will used in dateModified schema property along with existing datePublished property. I did it for all the posts. Since we now including both the dates it won’t be a issue. Google search already respecting the both.

https://github.com/discourse/discourse/commit/2c12336c6b7c8223d4fa00b2e928e276224f05a5

8 个赞

pr-welcome tag added

1 个赞

我知道这是一个非常老旧的帖子,但我只是想表达我对这种方法的支持。我将来会通过更官方的渠道/建议进行跟进,但我想在这里回复一下,因为这是你自己的想法。

我的名字是 Ryan Levering,我负责 Google 的结构化数据提取工作(这个人)。Discourse 有点特别,它是为数不多的在每个评论的根级别使用 DFPs 的论坛引擎之一。这使得我们更难确定页面的类型,以及权威地检测页面上的主帖。

我们将建议每个人都使用 DiscussionForumPosting 作为 OP(原始帖子),然后将回复附加到原始帖子,使用 http://schema.org/comment,就像 OP 中推荐的那样。其他标记也会很有用(例如,更多用户交互统计数据),但这种重组将大大有助于我们更容易地将 Discourse 论坛纳入我们的功能中。

13 个赞

瑞安,您好:

感谢您的告知。我们将尽快进行必要的更改。

5 个赞

此 PR 将实现 上方 推荐的行为。

10 个赞

我不确定这与您正在做的事情有多大关系,但谷歌在检测我网站上的帖子/主题时遇到了麻烦。规范 URL 可能对您确定页面上的确切主要帖子有一定影响。

我刚刚收到一个谷歌快讯,像这样的帖子 URL 被索引了:

  • https://forum.example.com/t/the-slug/123/16

Google Search Console 确认确切的 URL 在“Google 上”被索引。

但谷歌抓取的规范 URL 不同:

<link rel="canonical" href="https://forum.example.com/t/the-slug/123" />

按照 Discourse 目前的设置,这些帖子 URL 不应该被索引,因为规范 URL 都指向主题。

如果您想看到这类 URL 被索引,请为类似 site:meta.discourse.org 的内容设置一个谷歌快讯,并选择“所有结果即时发生”。

我不是规范化专家,所以我在这里不应该说错话。但我很确定这无关。据我所知,标记在规范化中根本不使用。而且,虽然我猜想通过一个非规范化 URL 拥有一些声明 mainEntityOfPage: 的标记来混淆系统是可能的(这样看起来标记就断言它是来自另一个页面的主要帖子),但我还没有遇到过这种情况。

不过,既然我们谈到了这个话题,Discourse 目前断言每个评论/非首帖都是 mainEntityOfPage: 。我相信在修复更改后,这仍然是真的。这也会混淆检测(并且意味着我们必须完全放弃这个断言)。我认为有了修复,它现在就能给我们足够的信号来防止问题,但可能最好只在首帖上使用它。

6 个赞

这正在处理中:

@rrlevering 如果您有空闲时间,我将非常感谢您对此的反馈:

3 个赞