DEV Community

Cover image for Bringing together Mastodon and WordPress
christine
christine

Posted on • Originally published at christine-seeman.com on

Bringing together Mastodon and WordPress

Reading Time: 2 minutes

WordPress.com announced the release of the ActivityPub plugin on their blogs in October, 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 excellently run ruby.social instance) since November 4th, 2022. Coming from the bird site, it was a bit of a shock but in a good way. But it was also confusing, 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 make my WordPress site and posts publish 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 a bit more configuration than what was addressed in the WordPress.com announcement.

I am on Flywheel as my WordPress host, and it seems like I might need some additional redirects in my .htcaccess because in my site health, my webfinger kept on 404ing. But Flywheel doesn’t allow direct htcaccess but I can add redirectsthrough 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:christine@christine-seeman.com”, which does not work.


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

I am 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 and now you can subscribe to my infrequent posts from my blog, hi-from@christine-seeman.com, or from me as an author (which umm not so many other authors on my website) christine@christine-seeman.com.

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

Top comments (0)