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.

Does Discourse support Google Structured Data (i.e.
(Jeff Atwood) #2

Can you post the markup you are referring to please?


Hey there @codinghorror, thanks for the reply.

If you test this threads link in
it will give you the invalid markup.

I am attaching an image bellow

Hope that helps :slight_smile:

(Jeff Atwood) #4

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

(Vinoth Kannan) #5 (the vocabulary) doesn’t require any properties.

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

For more details html5 - 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

(Jeff Atwood) #6

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

(Vinoth Kannan) #7

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).


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:

(Jeff Atwood) #9

Seems like they are still required:

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 -

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.


Couldn’t agree more.

Thanks guys that was an amazing fast response!

(Vinoth Kannan) #11

PR created 'Article' to 'DiscussionForumPosting' schema type by vinothkannans · Pull Request #4702 · discourse/discourse · GitHub

(Régis Hanol) #12

(Neil Lalonde) #13

(Neil Lalonde) #14

@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.


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

(Neil Lalonde) #16

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


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

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

(Vinoth Kannan) #18

Yes. I just changed the schema type for now.

Different schema type for Topics and Posts
(technicallyrite) #20

(technicallyrite) #21

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