XF 2.3 Structured data errors in Search Console – Missing "url" in "author" + media type not specified

#Anakin

Member
Hi everyone,
I’m trying to fix some structured data issues reported by Google Search Console on my XenForo forum.

These are the main errors:

  1. Missing field "url" (in "author")
  2. You must specify "text", "image", or "video"
Due to these issues, the affected elements are marked as invalid and not eligible for rich results.


I added the following JSON-LD script at the end of the PAGE_CONTAINER template:

Code:
<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "DiscussionForumPosting",
  "headline": "{$thread.title|escape('json')}",
  "articleBody": "{$firstPost.message|strip_tags|escape('json')}",
  "author": {
    "@type": "Person",
    "name": "{$firstPost.User.username|escape('json')}"
  },
  "datePublished": "{$thread.post_date|date('c')}",
  "interactionStatistic": {
    "@type": "InteractionCounter",
    "interactionType": "https://schema.org/CommentAction",
    "userInteractionCount": {$thread.reply_count}
  }
}
</script>


I'm aware that in newer versions of XenForo, it's no longer possible to directly edit templates like thread_view or post_macros, so I had to insert the script at the end of PAGE_CONTAINER, but that limits the available variables.


Questions:
  • How can I correctly add the missing "url" field inside the "author" object (ideally pointing to the user’s profile)?
    I was thinking something like:
    "url": "{$link('members', $firstPost.User)|escape('json')}" — would that work?
  • Where should I specify "text", "image" or "video" to satisfy the second requirement?
  • Is there a recommended way to manage structured data in XenForo when access to more specific templates is restricted?

Thanks in advance to anyone who can help clarify or suggest a cleaner solution. I’d really like to make the affected pages eligible for rich results again.
 
Not again yet ... :(
There are zillions of threads for this issue already.

Tl;Dr Ignore those warnings, you can't do anything realistically and some of those warnings are just unfixable.
 
Thanks for the reply, but honestly, this isn’t very reassuring.

If these warnings are "unfixable" and we’re supposed to just ignore them, that means I’ll be stuck with a limited or partially restricted AdSense setup because Google uses these structured data issues to evaluate eligibility for certain features and monetization.

I totally understand there are many threads about this, but that’s exactly the problem it’s widespread, yet there’s no clean solution or guidance from XenForo. I’m not looking for perfection, just the best possible workaround to reduce the errors and make my forum more compliant in Google’s eyes.

If anyone has managed to reduce these warnings even partially or has a cleaner implementation, I’d love to hear it.
 
With the sole exception of individual posts without textual content (which are a tiny subset of all posts and don't typically yield useful metadata anyway), we already offer the best possible schema out of the box. Letting Google know that a post contains an embedded image or video likely won't improve ad relevance much on the whole, but it's still something we'll address eventually.

The author URL will only be missing for posts from guests/deleted members, for which there is simply no URL to provide. It's unfortunate that Google presents these as issues which are urgent to address, but we have little control over that.
 
Maybe, but the real-world effect of that warning is that if such a post is selected for a rich result, the username won't be linked to a profile. It's not a huge deal, and it doesn't impact ranking or anything.
 
Back
Top Bottom