Google Structured Data -- Invalid Article Schema

Hey there Discourse team,

I am totally new here and I love what you have done so far. I noticed that when someone replies to a thread created in Discourse forums that answer is marked as an Article with microdata.

This comes up as invalid at Google’s Testing Tool since it is missing a few markups such as “headline”, “image” and “publisher” which are required when Article is being used.

Is that something that was discussed previously? If yes please feel free to delete my Topic.

2 Likes

Can you post the markup you are referring to please?

Hey there @codinghorror, thanks for the reply.

If you test this threads link in
https://search.google.com/structured-data/testing-tool
it will give you the invalid markup.

I am attaching an image bellow

Hope that helps :slight_smile:

4 Likes

If it is not an article what should it be? Which type is correct there?

Schema.org (the vocabulary) doesn’t require any properties.

Google’s Structured Data Testing Tool is not a Schema.org validator. The tool primarily tests if your use of Schema.org conforms to Google’s own requirements for showing one of their Rich Snippets (or similar features/products).

For more details html - schema.org microdata - image required for Article - Stack Overflow. But still we can try to fulfill Google’s requirements.

I am not sure. But there are some options like below

5 Likes

OK, if you wish to take that please do. A PR is welcome. Can be included in your other paid work as well :wink:

2 Likes

Yes I can do :thumbsup:

Now I am going to replace Article schema type with DiscussionForumPosting for all posts (both topic’s first post and replies).

But still Google may ask those required tags (like image, headline, publisher).

6 Likes

Hey there @vinothkannans thats true, schema itself does not require anything more but I guess making it compatible with Google’s requirements as well is quite in the interest of all :slight_smile:

My solution would be :
For the image give the image add the image url of the person posted the comment

For the headline keep the headline of the topic

For the publisher I am a bit confused.

All of these though are pretty hypothetical because if you change the article with DiscussionForumPosting Google might not even require all these :slight_smile:

1 Like

Seems like they are still required:

Hello
I was advised against using Article type in a forum website
So I googled for some suitable schema type for [forums] and found about this one

DiscussionForumPosting
DiscussionForumPosting - Schema.org Type

Google tool recognize this type and required these properties as shown in the image above and listed below

  • author: missing and required
  • datePublished: missing and required
  • headline: missing and required
  • image: missing and required
  • name: missing and required
  • publisher: missing and required

For now I would just change the schema type as DiscussionForumPosting seems much more correct.

7 Likes

Couldn’t agree more.

Thanks guys that was an amazing fast response!

1 Like

PR created https://github.com/discourse/discourse/pull/4702

6 Likes

@tolkin reported to me that Google is still showing posts as invalid:

The image requirement is bizarre. It needs to be an image of the item (the post in this case), not an image contained in the post (which usually won’t exist) or from some metadata about the post. Google’s tool should be showing that as a warning if at all. I’ll add the headline attribute.

4 Likes

I cannot be sure, but it appears the only change that was made to the code was to change the schema type from Article to DiscussionForumPosting, which doesn’t solve the problem.

The change did not include the Google required attributes:

  • author: missing and required
    • This could be the poster name
  • datePublished: missing and required
    • This could be the posted date
  • headline: missing and required
    • This should the topic subject
  • image: missing and required
    • This sould be the poster’s avatar image
  • name: missing and required
    • I have no idea what this is… perhaps the poster’s name again?
  • publisher: missing and required
    • I believe this is the site name
1 Like

My screenshot is from Google’s tool. I added the heading today, but the image attr doesn’t make sense.

2 Likes

For what it’s worth, there are SEO advantages to getting this feature in place, based on this article:

https://blog.kissmetrics.com/get-started-using-schema/

Considering much of a forum’s success depends on organic traffic, this could be a real benefit to the software.

2 Likes

Yes. I just changed the schema type for now.

1 Like

Looks like the latest version recently fixed the errors. :grin:

5 Likes