Different schema type for Topics and Posts

AI-generated summary

The discussion revolves around using different schema types for topics and posts in Discourse. vinothkannans suggests using DiscussionForumPosting for the entire topic and Comment schema type for replies. This approach is supported by rrlevering, a Google employee, who recommends this structure for better detection of the main post and page type.

vinothkannans also mentions that Discourse now includes both datePublished and dateModified schema properties for posts, which should resolve issues with Google search results showing outdated publication dates.

PoojaPatel raises the issue of hiding the datePublished property from Google search results, but vinothkannans explains that this is not an error, just a warning. PoojaPatel also asks about showing the last updated date instead of the publication date in Google search results.

rrlevering clarifies that canonical URLs are unrelated to markup and that Discourse’s current assertion of mainEntityOfPage for every comment is confusing detection. rrit mentions that this issue is being addressed in ongoing pull requests.

A pull request PR #20932 has been created to implement the recommended schema structure.

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” ?

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 태그가 추가되었습니다

1개의 좋아요

이 스레드가 꽤 오래된 걸 알지만, 이 접근 방식에 대한 지지를 표명하고 싶어서 글을 남깁니다. 향후 더 공식적인 채널이나 권장 사항을 추가로 공유할 예정이지만, 이 아이디어가 본인 것이라서 먼저 여기에 언급하고 싶었습니다.

저는 Ryan Levering이며, Google에서 구조화 데이터 인제스트를 담당하고 있습니다(이 사람). Discourse는 스노플레이크(유일무이한 사례)에 가까워서, 스레드의 각 댓글에 대해 루트 레벨에서 DFP(Structured Data for Forum Posts)를 사용하는 거의 유일한 포럼 엔진 중 하나입니다. 이로 인해 페이지의 유형을 파악하는 것뿐만 아니라, 페이지의 메인 게시물을 권위 있게 감지하는 것도 어려워집니다.

앞으로 우리는 OP(첫 번째 게시물)에는 DiscussionForumPosting을 사용하고, 나머지 응답들은 이 스레드의 OP에서 권장된 대로 원본 게시물에 http://schema.org/comment로 연결하는 것을 모두에게 권장할 예정입니다. 다른 마크업(예: 더 많은 사용자 상호작용 통계 등)도 유용할 수 있지만, 이러한 구조 재편은 Discourse 포럼을 우리의 기능에 포함시키는 것을 훨씬 쉽게 만들어 줄 것입니다.

13개의 좋아요

라이언님,

알려 주셔서 감사합니다. 필요한 변경 사항을 가능한 한 빨리 진행하겠습니다.

5개의 좋아요

이 PR은 위에서 권장된 동작을 구현합니다.

10개의 좋아요

지금 하고 계신 작업과 얼마나 관련이 있는지는 정확히 모르겠지만, 구글은 제 사이트에서 포스트/토픽을 감지하는 데 어려움을 겪고 있습니다. 캐노니컬 URL이 페이지의 정확한 메인 포스트를 결정하는 방식에 일부 영향을 미칠 수 있습니다.

방금 이런 형태의 포스트 URL이 인덱싱되고 있다는 구글 알림을 받았습니다:

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

구글 서치 콘솔은 해당 URL이 정확히 “구글에” 인덱싱되어 있음을 확인해 줍니다.

하지만 구글이 가져온 캐노니컬 URL은 다릅니다:

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

현재 Discourse가 설정된 방식에 따르면, 캐노니컬 URL이 모두 토픽을 가리키기 때문에 이러한 포스트 URL은 인덱싱되지 않아야 합니다.

이러한 유형의 URL이 인덱싱되는 것을 보고 싶다면, site:meta.discourse.org와 “모든 결과”(all results as they happen)를 설정한 구글 알림을 만들어 보세요.

저는 정규화(canonicalization) 전문가가 아니므로 여기서 잘못된 말을 해서는 안 됩니다. 하지만 제 생각에는 이 문제가 정규화와는 무관할 것입니다. 제가 아는 한, 정규화에는 마크업이 전혀 사용되지 않습니다. 비정규화 URL에 mainEntityOfPage: <canonical-url>이라고 적힌 마크업이 포함되어 있어(다른 페이지에서 이 마크업이 메인 포스트를 주장하는 것처럼 보이게 함) 시스템이 혼란을 겪을 가능성은 있을 수 있겠지만, 아직 그런 사례를 본 적은 없습니다.

그런데 이 주제에 대해 이야기하고 있는 만큼, Discourse는 현재 모든 댓글/첫 번째 게시물이 아닌 포스트에 대해 mainEntityOfPage: <url>라고 주장하고 있습니다. 수정이 적용된 후에도 이 상태가 유지될 것으로 생각됩니다. 이 부분 역시 감지를 혼란스럽게 만듭니다(그리고 이 주장을 완전히 제거해야 함을 의미합니다). 수정이 적용되면 이제 문제를 방지하는 데 충분한 신호를 제공할 것이라고 생각하지만, 첫 번째 게시물에만 이 주장을 사용하는 것이 더 나은 방법일 것입니다.

6개의 좋아요

현재 이 문제가 해결되고 있습니다:

@rrlevering 시간이 허락하신다면, 다음에 대한 피드백을 정말로 감사히 받겠습니다:

3개의 좋아요