dfabulich
(Dan Fabulich)
November 27, 2023, 7:33pm
1
Google just announced a new way for forum sites to tag their content as “structured data” for SEO purposes.
https://developers.google.com/search/blog/2023/11/discussion-and-profile-markup
New in structured data: discussion forum and profile page markup
Monday, November 27, 2023
Today we’re announcing support for profile page and discussion forum structured data for use in Google Search, including new reports in Search Console. This markup works with Google Search features that are designed to show first-person perspectives from social media platforms, forums, and other communities. Implementing this structured data will help ensure what Search shows in these features is as accurate and complete as possible.
It would be great if Discourse were to add support for these. (They support JSON-LD and microdata.)
4 Likes
4r33
(Bloody blackcat433)
November 27, 2023, 7:38pm
2
That’s cool (this is more confusing than the forums)
1 Like
@Falco Given this update where Google identifies members, wouldn’t it be ideal to have member profiles without noindex in the discourse?
2 Likes
Discourse definitely should support this!
1 Like
I would also love to see this one!
Falco
(Falco)
November 28, 2023, 5:53pm
6
Ain’t we using that already for many years ?
<a href='<%= "#{Discourse.base_url}/tag/#{tag.name}" %>' class='discourse-tag' rel="tag"><%= tag.name -%></a><% if i < @tags.size - 1 %>, <% end %>
<% end %>
</div>
</div>
<% end %>
</div>
<%= server_plugin_outlet "topic_header" %>
<%- if include_crawler_content? %>
<div itemscope itemtype='http://schema.org/DiscussionForumPosting'>
<meta itemprop='headline' content='<%= @topic_view.title %>'>
<% if @topic_view.topic.category.present? %>
<meta itemprop='articleSection' content='<%= @topic_view.topic.category.name %>'>
<% end %>
<meta itemprop='keywords' content='<%= @tags.map(&:name).join(', ') %>'>
<div itemprop='publisher' itemscope itemtype="http://schema.org/Organization">
<meta itemprop='name' content='<%= SiteSetting.company_name.presence || SiteSetting.title %>'>
<% if application_logo_url.present? %>
<div itemprop='logo' itemscope itemtype="http://schema.org/ImageObject">
<meta itemprop='url' content='<%= application_logo_url %>'>
Is the new thing here only the profile part?
Jagster
(Jakke Lehtonen)
November 28, 2023, 6:30pm
7
Kind of yes. It has tailored a bit better suitable for social medias, I reckon.
dfabulich
(Dan Fabulich)
November 28, 2023, 10:07pm
8
Y’all can check your Google Search Console report, but when I go to https://search.google.com/search-console/r/discussion-forum and check my forum, I see this:
Why items are invalid:
Either “text”, “image”, or “video” should be specified
Missing field “datePublished”
Missing field “author”
Improve item appearance
Missing field “url”
Missing field “text” (in “comment”)
So there does appear to be more work to do here.
3 Likes
rrit
(Ayke)
December 17, 2023, 4:21pm
9
1. itemprop="text"
Just always add itemprop="text"
here, as articleBody
is not specified (anymore?) for DiscussionForumPosting .
2. mainEntityOfPage
mainEntityOfPage
must only be set once for DiscussionForumPosting
and never for the multiple Comment
:
e.g. check for post.is_first_post
3. itemprop="url"
Add itemprop="url"
to the itemscope of DiscussionForumPosting
.
This ensures that comments on subpages (…?page=2
) are bound to the main topic page.
<link itemprop="url" href="???">
post.topic.url
is not set here. Is there something like @topic_view.url
?
Important: the itemprop url
must point to the first page of the topic in crawler view:
e.g. https://example.org/t/topic-title/1234
not https://example.org/t/topic-title/1234?page=2
See DiscussionForumPosting → Recommended properties → url
url: The canonical URL of the discussion. In multi-page threads, set this property to th first page URL. For a single discussion, this is usually the current URL.
1 Like
rrit
(Ayke)
December 17, 2023, 4:45pm
10
Which version of Discourse are you running?
Distinct marking of DiscussionForumPosting
and Comment
was implemented with Discourse v3.1.0 released August ’ 23.
committed 09:06AM - 03 Apr 23 UTC
Previously, we used the schema type "DiscussionForumPosting" for all the posts i… ncluding replies. This is not recommended as per Google search experts. This commit changes the schema type to "Comment" for replies.
dfabulich
(Dan Fabulich)
December 17, 2023, 7:21pm
11
I’m running the CDCK hosted version, always latest. The Discourse team can repro this by checking Google Search Console for meta.discourse.org .
mcwumbly
(Dave McClure)
December 17, 2023, 10:55pm
12
I think @techAPJ is looking into a related request here:
As @Arkshine explained above this is not a bug but rather a suggestion from Google to add optional field in the schema. I’ll look into it.
3 Likes
Thanks all. I’m hoping this gets some attention at the start of the new year here. Very interested in optimizing everything as possible for Google SEO; let me know if I can help.
techAPJ
(Arpit Jalan)
January 1, 2024, 8:27am
14
Let’s keep the discussion happening in this topic where we’re trying to figure out a solution for all the structured data related issues.
Yes, we’re doing that now per the recent commit but even after adding that we’re missing some required fields (author, datePublished, text) for subsequent pages (?page=2).
Great catch! Fixed in this PR:
Oh yeah. This was also confirmed by @rrlevering here:
So I guess we’ll have to improve microdata schema while making sure we do not end up duplicating content on subsequent pages.