Schema for phpBB is a free phpBB 3.3.x extension by ButtonPusher that adds Schema.org DiscussionForumPosting structured data to forum topic pages.
The extension is designed for Google forum structured data and uses Microdata connected directly to the content already visible on the page. Full post and reply text is not duplicated in a separate JSON-LD block.
Support and discussion on phpBB.com: Schema for phpBB extension topic.
Features
- Schema.org
DiscussionForumPostingmarkup for phpBB topic pages. - Replies on the current topic page are represented as
Commentitems when they contain supported text or images. - Topic headline and canonical topic URL.
- Author name and author URL when available.
- Public profile URLs for registered users.
- Support for guest and deleted-user authors, including localized fallback names without invalid profile links.
- Publication and modification dates.
- Complete visible post text exposed through Microdata without duplicating it in the page source.
- Reply count through
commentCount. - Topic view count using
InteractionCounterandViewAction. - Parent forum information.
- Inline post images included in the
imageproperty. - phpBB image attachments use the full image URL instead of the generated thumbnail URL.
- phpBB smileys and content icons are excluded from the Schema.org
imageproperty. - Smiley-only replies are excluded from
Commentmarkup to prevent Google's missingtext,imageorvideowarning, while still being counted incommentCount. - Support for paginated topics.
- Safe handling of topics whose original post is deleted, hidden or otherwise unavailable.
- Compatible with ButtonPusher Clean URLs when that extension is enabled.
- No database tables or migrations.
- No Administration Control Panel settings required.
- No phpBB core file modifications.
How it works
Forum posts can contain a large amount of text. Copying the complete topic and every reply into a second JSON-LD block would unnecessarily duplicate content in the generated HTML.
Schema for phpBB instead marks the already-rendered phpBB message with the Schema.org text property and connects it to the corresponding DiscussionForumPosting or Comment item.
This keeps the structured data closely connected to the content users actually see while avoiding a second copy of every post in the page source.
Topics and replies
The first post is used as the main DiscussionForumPosting when its content is available. Replies displayed on the current page are added as Comment items when they contain supported text or images.
Replies containing only phpBB smileys are not emitted as Comment items. A smiley's HTML alt attribute is not treated as visible post text, and decorative smiley images are not presented as content images. These replies remain included in commentCount.
If the original post has been deleted, hidden or is otherwise unavailable on the first topic page, the extension avoids generating an incomplete DiscussionForumPosting without a valid text, image or video property. This prevents critical structured data errors without inventing missing post content.
On paginated topics, the main posting continues to reference the first topic page, while replies use their permanent post URLs. When ButtonPusher Clean URLs is installed and enabled, Schema for phpBB automatically uses the corresponding clean topic, forum, profile and post URLs.
Images
The extension only adds real content images to the Schema.org image property.
Inline images and phpBB image attachments are detected automatically. For attachments, the full image URL is used instead of the smaller technical thumbnail generated by phpBB.
Smileys, icons and similar interface graphics are intentionally excluded because they are not representative images for the post. Replies combining normal text with smileys remain eligible for Comment markup.
For a text-only topic, Google Rich Results Test may display the warning Missing field "image" (optional). This is expected and does not make the structured data invalid.
Legacy video posts
Some older phpBB [video] integrations render only a player placeholder in the server-side HTML and do not expose enough information to create a valid Schema.org VideoObject.
A reply containing only such a legacy video widget is therefore not emitted as a standalone Comment unless it also contains supported text or images. The reply is still included in commentCount.
This avoids creating incomplete Comment markup with no valid text, image or video property.
Requirements
- phpBB 3.3.0 or newer in the phpBB 3.x series.
- PHP 7.2 or newer.
Included languages
The extension includes language packs for Czech, German, English, Spanish, French, Hebrew, Italian, Polish, Portuguese, Brazilian Portuguese, Russian, Turkish and Ukrainian.
Installation
- Download the extension archive.
- Extract it into your phpBB installation so that the extension files are located in:
ext/buttonpusher/schema/ - Open the phpBB Administration Control Panel.
- Go to Customise → Manage extensions.
- Find ButtonPusher Schema for phpBB Forums and click Enable.
- Clear the phpBB cache.
To upgrade an existing installation, disable the extension without deleting its data, replace the extension files with the new version, enable it again and clear the phpBB cache. If an older PHP file remains cached, also clear PHP OPcache.
No changes to phpBB core files, templates or the database are required.
Validation
After installation, open a public topic and test its URL with Google Rich Results Test or the Schema.org Markup Validator.
It is useful to test several types of topics: text-only posts, topics with multiple replies, replies containing only smileys, text mixed with smileys, image attachments, inline images, paginated discussions and topics with deleted or unavailable original posts.
Smiley-only replies should not appear as incomplete Comment items, but should still be included in the total commentCount.
Version 1.0.2
- Fixed the Google Search Console
Commentwarning Specify "text", "image" or "video" for replies containing only phpBB smileys. - Corrected content detection so a smiley image's
altattribute is no longer mistaken for actual post text. - Excluded smiley-only replies from
CommentMicrodata instead of generating an emptytextvalue or using decorative icons as content images. - Preserved the full reply count in
commentCount, including smiley-only replies omitted from structuredCommentitems. - Preserved handling of normal text replies, text mixed with smileys, real inline images and phpBB image attachments.
- No database changes or migrations required.
Version 1.0.1
- Fixed the missing
author.nameerror in Schema.orgDiscussionForumPostingwhen the original topic author's username is empty or unavailable. - Added a localized guest-name fallback for authors whose usernames can no longer be resolved.
- Improved handling of deleted or unavailable user accounts by avoiding invalid author profile URLs.
- Fixed the Google Rich Results Test critical error Specify "text", "image" or "video" for topics whose original post is no longer available.
- Prevented incomplete
DiscussionForumPostingmarkup from being generated on the first topic page when the original post is missing, hidden or deleted. - Preserved structured data generation for regular topics and paginated discussions.
- Improved compatibility with older forum topics containing deleted posts or unavailable authors.
- No database changes or migrations required.
Version 1.0.0
- Initial public release.
- Added Schema.org
DiscussionForumPostingMicrodata for phpBB topic pages. - Added structured data for authors, dates, replies, view counts and parent forums.
- Added inline image and image attachment detection.
- Added support for paginated topics.
- Added compatibility with ButtonPusher Clean URLs.
- Excluded phpBB smileys from structured content images.
- Improved handling of legacy video-only replies to avoid invalid
Commentmarkup. - Added Czech, German, English, Spanish, French, Hebrew, Italian, Polish, Portuguese, Brazilian Portuguese, Russian, Turkish and Ukrainian language packs.
Download
Download Schema for phpBB 1.0.2
Current version: 1.0.2
License: GNU General Public License v2.0 only (GPL-2.0-only).
Comments (0)