It looks like you’re 90% of the way there. I suspect the last piece you’re missing are the proper microformats either in your theme or in the_body
of your specific reply. I suspect you know what microformats are Paul, but for context and the benefit of others reading, they’re bits of metadata added into HTML as classes that provide computers additional information about what is in your post and what each part represents.
For implementing Webmention with WordPress, the Semantic Linkbacks plugin has a built in parser that looks at the microformats of the incoming webmentions and uses that data to decide what to display in your comments section. The first part it looks for is an h-card
which is a microformats version of a business card that generally includes the post author’s name, photo/avatar, and URL. This is how the system determines the avatar and name to use.
The second part it’s looking for in the received webmention is an h-entry
(or hentry
in the older microformats v1 specification). This defines the broader body of the comment that it will display. And the last big part that the parser is looking for is what kind of response was sent. Was it a simple reply, like, a bookmark, a read, a listen, etc.? If it can’t figure out what the specific reply may have been it defaults to a simple “mention” which is the response that you’re seeing in your example Paul.
The positive part of this system is that WordPress already has some reasonable support for microformats v1 built into core and many themes even extend on it relatively well. Sadly, WordPress doesn’t support microformats v2, which would make it a far better IndieWeb friendly platform. Fortunately most themes have h-card
or hcard
along with the related microformats that go on the names, URLs, and avatars. Unfortunately they don’t have the microformats that indicate the response types.
To fix this many people IndieWeb-ifying a site use a theme with strong Microformats v2 mark up like SemPress (or one of its children) and they’re doing it in combination with the Post Kinds plugin which adds the microformats to the response to indicate the proper type. Post Kinds, a dramatic expansion of the idea of Post Formats by the way, also has a built in parser which kindly provides a reply context for your posts as well.
If you’re not using (or don’t want to use) Post Kinds you can manually add the required mark up in your posts to indicate the type. Most of these are documented on the IndieWeb wiki, here’s an example for a typical “reply“:
<div class="h-entry"> <a href="http://example.com/note123" class="u-in-reply-to">Some note with a point</a> <div class="p-name p-content">Good point! Now what is the next thing we should do?</div> </div>
In this example the important microformats are the u-in-reply-to
and the p-name
p-content
. Generally most WordPress themes will add either h-entry
(or hentry
) in the theme, so you just need the u-in-reply-to
piece.
Again, most people get around the need to add these microformats by using Post Kinds plugin while others use a version of the old core Press This bookmark functionality that was adopted for use as IndieWeb Press This. IndieWeb Press this bookmarklet will take a page you want to reply to, like, or bookmark, then create a post with the requisite microformats, and finally allow you to write your reply and publish pretty quickly.
Yet another method to get around some of the required microformats is to publish using a Micropub client in combination with the WordPress Micropub plugin.
The upshot is that once you’ve arranged the basic pieces, your publishing process proceeds apace as before.
And of course, to be even more upfront, I’ll mention that some of the replies I’ve sent to Paul in the past (and you can see this in the example screenshot he includes) mistakenly include my reply context to his post in them. This is a result of my having overwritten some theme changes in my site that once upgraded my lowly mf1 hentry
to the better mf2 h-entry
. As a result the parser inside the Semantic Linkbacks plugin falls back to parsing as microformats version 1 and includes the context instead of stripping it out and just sending only the piece that is the intended reply. The reply that should have shown up on Paul’s post was the portion he outlined in red. I’ll try to fix this again shortly.
For those looking to help spread the ideas and functionality of the IndieWeb within WordPress, we’d all love help to:
- Improve WordPress’ core support for Microformats version 2
- Better support for Microformats v2 in more Themes
I and others have documented some other subtleties and resources for microformats with respect to WordPresss and themes on the IndieWeb wiki which should be of help for those of a variety of development levels. Obviously we still have a way to go towards making all this more intuitive, obvious, and user friendly, but we’re getting there day by day. Any extra help and feedback is always helpful.
If you’ve got questions, need help, or have suggestions, feel free to hop into the IndieWeb WordPress chat and we can try to get you up to speed.
Thanks for the pointer there, Chris. You’re right, I didn’t have Microformats 2 implemented in my test. I’ve been using the Microformats 2 plugin. It doesn’t seem to be maintained, but I’ve reinstalled it on this site, and will install it on my test sites too.
Thank you for explaining this again.
I really like the Post Kinds plugin, and I’m looking forward to when it works with the block editor. I really enjoy using the Gutenberg editor, so I’ve had to give up on using Post Kinds for the time being.
Micropub fascinates me, even though I really don’t have a clear understanding of how to use this technology.
It looks like the drive to add Microformats 2 support into WordPress Core went quiet a couple years ago. It would be great to see a new drive to have support for this, and other IndieWeb technologies added to Core.
The tools have evolved really nicely in recent years. I’d love to see this stuff be better integrated into the tools that people use daily, in the not too distant future.
Generally the mf2 plugin has been abandoned as an approach and it isn’t recommended anymore, though it does fairly well with some themes. You’ll notice that on your site the author block and the top of the comments block have some visible p-tags on them because your theme obviously does some escaping for standard functionality. Disabling the plugin will clear that issue up.
Post Kinds may eventually be upgraded for Gutenberg, but the primary developer needs some help with the JavaScript portions as those aren’t his strong suit. If you know of anyone who can help on this front, I’m sure he’d love the extra hand(s). I suspect once one or two of the standard Post Kinds blocks have been built, doing all the rest will be relatively straightforward.
For Micropub, if you’ve got the time and curiosity, I gave a short talk on Micropub and WordPress at WordCamp Santa Clarita Valley earlier this year.
You’re right about the microformats effort. If I had one wish for 2020, it would be for WordPress to add mf2 to core. It’s one of the simplest underlying building blocks and it would make all the other pieces like Webmention, Micropub, and even Microsub so much more concrete and stable for the entire WordPress universe. I’ll have to take a look at the relevant issues in trak, but because it’s just a few additional classes that almost no one is currently using, it shouldn’t have any tremendous backcompat issues–particularly as it’s highly recommended that one not use microformats for CSS and display purposes.