Replied to How to send a Webmention in comments? by Paul Jacobson (Paul Jacobson)

I’ve had Webmentions enabled on this site for some time now. Sending a Webmention is pretty straightforward thanks to plugins like Webmention for WordPress and Semantic-Linkbacks. The question is how to send Webmentions in comments when someone replies to one of my posts?

Okay, this gives a lot more context!

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.

A screenshot of a reply context (highlighted in yellow) which indicates the post is about a favorite of Huffduffer which includes a blockquote from the Huffduffer site to show what the site is about. My commentary about the favorite appears beneath the reply context.

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“:


Some note with a point
Good point! Now what is the next thing we should do?


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.