Integrating WordPress and Mastodon using ActivityPub

Last year, Automattic (which runs WordPress.com) acquired an ActivityPub plugin for the WordPress CMS/blogging platform. This caught my eye, as Elon’s sabotage of Twitter was continuing apace, finally giving me impetus to switch over to Mastodon and explore it and the other services that interoperate with it through the ActivityPub protocol.

I installed the plugin on a couple of websites I run, and have been delighted to discover several interesting things:

  • ActivityPub makes a better-than-RSS replacement for RSS. Since ActivityPub is a bidirectional protocol, using it to keep up on websites allows commenters to interact with your site without having to visit.
  • The ActivityPub plugin runs quietly alongside your other syndication methods, and doesn’t require any additional care and feeding once it’s set up.
  • The plugin can also publish content types other than weblog posts. I use an event calendar plugin on one of the sites where I use ActivityPub, and have that site configured so that each of those also is published as an ActivityPub item when I post it.
  • The plugin works great out of the box with Mastodon. I haven’t tried it with other ActivityPub clients, but it seems to have enough flexibility around how articles are published to ensure that one could get it working smoothly without much fuss, and has explicit support for many other clients.

Setting Up and Using It

I’ll use my band’s website, www.thehappyout.com, as an example. Here’s what I did:

  • Installed and configure the ActivityPub plugin on my WordPress site.
  • Using my personal Mastodon account, searched for profile @news@www.thehappyout.com and followed it. (Thanks to WebFinger support, searching for www.thehappyout.com also works.)
  • Posts on the website now appear in my Mastodon feed.
  • I can now reply to these posts, just as I would to one that had originated in Mastodon.
  • These replies go through the normal WordPress moderation channels and appear on the website just like any comments would that originated on the site itself.

It’s great to see all of this interoperating so smoothly at this point. Big props to Matthias Pfefferle & Automattic for their investment here!

Open Issues

  • It’s common to link to social media sites with a bunch of icons. I can do that to a Mastodon profile, but haven’t figured out a good way to do so with this approach.
  • When an event is published through this mechanism, the time/date and location are not included in the ActivityPub item. If there’s a way to include this sort of metadata in one’s published feed, I haven’t yet figured it out.
  • How do authors who rely on advertising on-site manage monetization if readers don’t have to visit the site? (This was a question for RSS as well, and I suspect the answers will be similar: include ads in the feed itself, or only include excerpts in the feed so readers are still encouraged to visit the site proper.)