Bringing together Mastodon and WordPress

  • Post author:
  • Post category:WordPress
  • Reading time:3 mins read

Just today, WordPress.com announced the release of the ActivityPub plugin on their blogs. I don’t use WordPress.com, but it did make me aware of the plugin, so I decided to give it a go.

I have been on Mastodon (the excellent ruby.social instance) since November 4th, 2022. Coming from the bird site was a shock, but in a good way. But it also had its own learning curve, just like when you had to learn about Git coming from a CVS system like Subversion. One is distributed, and one is centralized.

Now, with the ActivityPub plugin, I can publish my WordPress site and posts to a federated profile and have people reply to that on ActivityPub but show up as WordPress comments. It is it’s own feed! This sounded pretty nifty, but my setup wasn’t just plug-and-play and required more configuration than what was addressed in the WordPress.com announcement.

I am on Flywheel as my WordPress host, and it turned out I needed additional redirects in my .htcaccess because my webfinger kept on 404ing in my site health. But Flywheel doesn’t allow direct .htcaccess file access, but I can add redirects through the Flywheel site. My first attempt at adding a redirect didn’t quite work as expected. I got instead a redirect to “https://wp-json//activitypub//1/.0//webfinger?resource=acct:[email protected]”. Which does not work.

Flywheel’s Add Redirect page for a site, this setup turned out to be not the correct regex.

Trying to simplify the redirect and make sure it hits the proper webfinger for ActivityPub (Mastadon)

This worked! So I needed to add into my source redirect ^/.well-known/webfinger(.*)$ and then for my destination /wp-json/activitypub/1.0/webfinger$1. Now you can subscribe to my infrequent posts from my blog, [email protected], or from me as an author (which umm not so many other authors on my website) [email protected].

Best of luck tying your WordPress and Mastodon/ActivityPub together 😁

This Post Has 3 Comments

    1. christine

      Hey There, I think the best place to tweak that would be to head to your settings, go to ActivityPub, and then there is both a “Blog profile” and a “Author profile” both of those can be customized to a different name.

Leave a Reply