Skip to content

Conversation

@MaKlaib
Copy link

@MaKlaib MaKlaib commented Jan 11, 2026

This PR fixes the Google Search Console warning: "Field 'datePublished' missing (in 'comment')".

Currently, the DiscussionForumPosting schema for replies (comments) lacks the required timestamp, which causes warnings in GSC.

Changes

  • event/listener.php: Extracted the post_time from the event row. If available, it is formatted as an ISO 8601 string. If the timestamp is missing, the field remains empty (to avoid invalid data).
  • includes/helper.php: Updated the logic to pass the datePublished field through to the final JSON output.

Result

The generated JSON-LD now correctly includes the datePublished property for forum replies. If a post time is not available, the property is omitted entirely to prevent errors, effectively resolving the GSC validation warning.

Fixes #125

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing field "datePublished" (in "comment")

1 participant