Google Structured Data -- Invalid Article Schema

Hi Discourse team,

First of all, I am new here, so I hope I am doing well posting here for a bug.

I tried to find an existing topic before to post a new one but I did not find anything, so I am sorry in advance if such topic already exists. Do not hesitate to link it or do whatever is necessary. Thank you.


So here is the issue I would like to report. As mentionned in the title, microdata on discourse do not fulfil with Google tool’s expectations.

On topic lists, Google tools reports more than 60 errors :


example of the main topic list

for more details, see this test

There is also errors on posts :

for more details, see this other test


My company is using discourse as forum for 3 of our websites. We greatly consider the SEO aspect and would be thankful for you to correct all possible errors in microdata.

So is it possible for you to fix microdata ?

5 Likes

Hi Discourse team,

I posted my question about two weeks ago. I assume fixing microdata will take a certain amount of time but since I got no answer yet I allow myself to ask you if the fix is on track and when it could be released ?

Thank you in advance for your work and your reply.

Are all 61 errors saying the same thing? <div itemprop='itemListElement' itemscope itemtype='http://schema.org/ListItem'> needs to have a “position” attribute?

The 61 errors count 3 different kind of error :

  • ItemList -> itemListElement -> url and/or ItemList -> itemListElement -> item -> url (30 times): All values provided for url must point to the same page.
  • ItemList -> itemListElement -> position (30 times): A value for the position field is required.
  • global to ItemList (1 time): ListItem with url and ListItem with item are incompatible.

As I mentioned it in my first post, you can follow the links I gave to see all details.

Hi @t_d ,

Any news about this subject ?
When do you think a fix will be released ?

Thx

1 Like

I can take it during june.

4 Likes

Invision Boards handle structured data well to see how it could/should be done.

I just pushed a commit to improve this:

https://github.com/discourse/discourse/commit/276526e30ea6e791f97e1a14d1d6bc7a2fc06be2

I will keep digging but I think the remaining errors are due to google validation tool:

https://search.google.com/structured-data/testing-tool/u/0/?hl=en#url=https%3A%2F%2Fmeta.discourse.org%2Flatest

https://search.google.com/structured-data/testing-tool/u/0/?hl=en#url=meta.discourse.org

https://search.google.com/structured-data/testing-tool/u/0/?hl=en#url=meta.discourse.org%2Fc%2Fsupport

https://search.google.com/structured-data/testing-tool/u/0/?hl=en#url=meta.discourse.org%2Ftags%2Fdocker

I still have this page to improve, will do it tomorrow:

https://search.google.com/structured-data/testing-tool/u/0/?hl=en#url=https%3A%2F%2Fmeta.discourse.org%2Ft%2Ftopic-stopwatch-theme-component%2F83939

Particularly this page has a warning with “DiscussionForumPosting” which is asking us to provide an image if possible. I think we could just add `itemprop=“image” when we cook the post to images. I will investigate this.

7 Likes

Hi @joffreyjaffeux ,

You fixed the issues regarding the “position” attribute.

But it still remains to resolve the uncompatibility between ListItem with “url” and ListItem with “item” Also, url attribute of each ListItem should point to the same page.

There is progress but still some work to do.

1 Like

Yes I’m continuing work on this today or tomorrow. Thanks for recap/update.

I will investigate more, but I do think there’s a bug in google tool here. Can you share me a test where it’s showing this for you please?

For example : https://search.google.com/structured-data/testing-tool/u/0/?hl=en#url=https%3A%2F%2Fmeta.discourse.org%2Flatest

I see:

    <div itemprop='itemListElement' itemscope itemtype='http://schema.org/ListItem'>
      <meta itemprop='position' content='0'>
      <meta itemprop='url' content='https://meta.discourse.org/t/color-scheme-contest-with-prizes/89432'>
      <a href='https://meta.discourse.org/t/color-scheme-contest-with-prizes/89432' itemprop='item'>
        <span itemprop='name'>Color Scheme Contest (with Prizes!)</span>
      </a>
      <span class="page-links">( <a href='/t/color-scheme-contest-with-prizes/89432?page=2'>2</a> )</span>
        <span class='category'>[<a href='/c/meta'>meta</a>]</span>
      <span class='posts' title='posts'>(22)</span>
    </div>

It seems weird to me that’s it’s not validated because the two elements with item prop have the same URL:

<meta itemprop='url' content='https://meta.discourse.org/t/color-scheme-contest-with-prizes/89432'>
<a href='https://meta.discourse.org/t/color-scheme-contest-with-prizes/89432' itemprop='item'>
  <span itemprop='name'>Color Scheme Contest (with Prizes!)</span>
</a>

I will look if it’s caused by the page-links or category link at the end of the block.

3 Likes

More than any error in google validation tool, I’m interested by errors you would see in the google search console.

Search console -> Search appearance -> Structured data If you have ERRORS in this section which you think are caused by Discourse, I’m very interested to fix these.

2 Likes

As you asked for, I checked the Search console -> Search appearance -> Structured data panel for both our websites using Discourse as forum (i.e. https://www.gamekult.com as GK and https://www.focus-numerique.com as FN). We have absolutly no errors caused by Discourse on GK and no errors at all on FN.

However, I do not see how it could be different since Discourse is not embeded in the source code of our website. As you should know (I guess), our Discourse instances are completely separated applications that are hosted separately (servers/network of your own). We just provide access to them from links in our websites.

Since the issue relates only to errors that appear on Discourse’s pages (https://meta.discourse.org or Discourse Meta - The Official Support Forum for Discourse for example), we provided you the link to the analysis of one of these urls : https://search.google.com/structured-data/testing-tool/u/0/?hl=en#url=https%3A%2F%2Fmeta.discourse.org%2Flatest

I think you should focus on this link and on the corresponding Discourse source code cause the issue really seems to concerns Discourse only.

Forum Jeux vidéo - Gamekult is a subfolder, you can totally configure search console on this subfolder and google recommends it: Add a website property to Search Console - Search Console Help

We recommend creating a separate Search Console property for each domain or folder that you want to track separately, as well as the lowest level domain that you own. For example, if you have a travel site with specific subfolders covering Ireland, France, and Spain, you could add the following sites to your Search Console account:

The fact that it’s not in your “main” application code doesn’t change anything here, google doesn’t inspect your source code. He tries to get an URL an sees what he gets that’s all.

And yes I’m focusing on this link too, but I get very confusing results in my tests and would like to cross check this with " REAL" data.

1 Like

I understand what you are saying.

I do not master Google Search Console so thank you for your explainations. I did not know about the subfolders.

I will try to give you as much information as possible.

Google search console :


As you can see for Gamekult, there is only few errors on VideoGame and Review data types.

Google structured data testing tool (GK - https://search.google.com/structured-data/testing-tool/u/0/?hl=en#url=https%3A%2F%2Fwww.gamekult.com%2Fforum) :


Here a first occurence of a unique error message on the right panel and the responsible source code line highlighted in grey on left panel


Here the second occurence of this unique error message on the right panel and the responsible source code line highlighted in grey on left panel. You can see that it is not the same line than for the first occurence (maybe it is relevant ?)

Google structured data testing tool (Discourse - https://search.google.com/structured-data/testing-tool/u/0/?hl=en#url=https%3A%2F%2Fmeta.discourse.org) :


Here you can see only one error instead of 2 on GK’s forum. But it seems to be the exact same one than one of GK

Remark :

  • both urls in the <meta> tag and the <a> tag are absolute on Discourse whereas the <meta> tag’s url is relative on GK. I do not know why or if it is relevant but I think it could explain why urls are considered different.

First of all, I thought this issue would be an easy one for you. But after reading your last answer (which was lightning for me), I understand better how strange is this issue from your side.

So I hope this long answer will be helpful, even if I may not have been precise enough regarding what answer you expected. I tried to answer your question and to provide you in the same time as much information as possible . If I missed something, do not hesitate to ask.

1 Like

Awesome! Thanks! I just pushed a commit for this btw, we will get there :wink:

6 Likes

seems my last fix improved this page: https://search.google.com/structured-data/testing-tool/u/0/?hl=en#url=https%3A%2F%2Fmeta.discourse.org%2Flatest

4 Likes