XF 2.0 How to add schema markup for threads?

djbaxter

in memoriam 1947-2022
As the title says, is there a way to auto-insert schema markup for Xenforo 2 threads? Either natively or with an addon?
 
I see two threads elsewhere from 2017 indicating that schema org was to be implemented in XF 2.

What version of XF2? Has this happened yet or is this something coming in 2.1.0?
 
Sorry. I'm confused.

I was expecting to see something similar to this (from a WordPress site) in the page source:

Code:
<!-- This site is optimized with the Schema plugin v1.7.2 - https://schema.press -->
<script type="application/ld+json">{"@context":"http:\/\/schema.org","@type":"Person","@id":"#person","name":"Dr. Janice Stuart, Psychologist","url":"https:\/\/drjanicestuart.com\/"}</script>

<script type="application/ld+json">
{
  "@context": "http://schema.org",
  "@type": "WebSite",
  "@id": "#website",
  "name": "Dr. Janice Stuart, Psychologist, Vancouver B.C.",
  "url": "https://drjanicestuart.com/",
  "potentialAction": {
    "@type": "SearchAction",
    "target": "https://drjanicestuart.com/?s={search_term_string}",
    "query-input": "required name=search_term_string"
  }
}
</script>

    <style type="text/css">
        /* admin bar */
        .schema_google_developers a {
            padding-left:30px !important;
            background:    transparent url('https://drjanicestuart.com/wp-content/plugins/schema/assets/images/admin-bar/google-developers.png') 8px 50% no-repeat !important;
        }
        .schema_google_developers a:hover {
            background:    transparent url('https://drjanicestuart.com/wp-content/plugins/schema/assets/images/admin-bar/google-developers-hover.png') 8px 50% no-repeat !important;
        }
    </style>

I don't see that in your example.
 
Oh, actually I do see this way down near the bottom of the page rather than in the head section:

Code:
        <ul class="p-breadcrumbs "
            itemscope itemtype="https://schema.org/BreadcrumbList">
        
            
            
            
                
                
    <li itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem">
        <a href="https://xenforo.com/" itemprop="item">
            <span itemprop="name">Home</span>
        </a>
        <meta itemprop="position" content="1" />
    </li>
            
            
                
                
    <li itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem">
        <a href="/community/" itemprop="item">
            <span itemprop="name">Forums</span>
        </a>
        <meta itemprop="position" content="2" />
    </li>
            
            
                
                
    <li itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem">
        <a href="/community/.#customer-forums.22" itemprop="item">
            <span itemprop="name">Customer forums</span>
        </a>
        <meta itemprop="position" content="3" />
    </li>
            
                
                
    <li itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem">
        <a href="/community/forums/styling-and-customization-questions.47/" itemprop="item">
            <span itemprop="name">Styling and customization questions</span>
        </a>
        <meta itemprop="position" content="4" />
    </li>
            
        
        </ul>
 
More specifically, the owner is looking to add Google's new Q&A structured data to threads (or cerain threads), like this example from Google:

Code:
<script type="application/ld+json">
  {
    "@context": "http://schema.org",
    "@type": "QAPage",
    "mainEntity": {
      "@type": "Question",
      "name": "How many ounces are there in a pound?",
      "text": "I have taken up a new interest in baking and keep running across directions in ounces and pounds. I have to translate between them and was wondering how many ounces are in a pound?",
      "answerCount": 3,
      "upvoteCount": 26,
      "dateCreated": "2016-07-23T21:11Z",
      "author": {
        "@type": "Person",
        "name": "New Baking User"
      },
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "1 pound (lb) is equal to 16 ounces (oz).",
        "dateCreated": "2016-11-02T21:11Z",
        "upvoteCount": 1337,
        "url": "https://example.com/question1#acceptedAnswer",
        "author": {
          "@type": "Person",
          "name": "SomeUser"
        }
      },
      "suggestedAnswer": [
        {
          "@type": "Answer",
          "text": "Are you looking for ounces or fluid ounces? If you are looking for fluid ounces there are 15.34 fluid ounces in a pound of water.",
          "dateCreated": "2016-11-02T21:11Z",
          "upvoteCount": 42,
          "url": "https://example.com/question1#suggestedAnswer1",
          "author": {
            "@type": "Person",
            "name": "AnotherUser"
          }
        }, {
          "@type": "Answer",
          "text": " I can't remember exactly, but I think 18 ounces in a lb. You might want to double check that.",
          "dateCreated": "2016-11-06T21:11Z",
          "upvoteCount": 0,
          "url": "https://example.com/question1#suggestedAnswer2",
          "author": {
            "@type": "Person",
            "name": "ConfusedUser"
          }
        }
      ]
    }
  }
</script>
 
Top Bottom