This article is based on the already well-written article on Fedi.Tips.
The idea is to automatically make all your blog posts on WordPress available on the Fediverse that people can follow on their apps such as Mastodon.
Caution: before doing this read the notes below around the downsides to this integration.
Doing this is really easy…
- Note that this will only work on self-hosted WordPress installations
- Note that there’s very limited configuration options
- Install the ActivityPub for WordPress plugin
- Activate it
- Done – on the plugin settings page it will give you the username and URL that can be shared for others to follow. Any new posts will start to appear to all followers.
Quick fix: when I installed the plugin and went to the Health Checks page, it was showing that my author page was not returning valid JSON with the error:
Your author URL https://cubewebsites.com/author/Cube Websites/ does not return valid JSON for application/activity+json. Please check if your hosting supports alternate Accept headers
The reason for this issue was that the author name format in the URL is from an old version of WordPress. To fix it all you need to do is:
- Connect to your database using a management tool e.g. phpMyAdmin, TablePlus etc
- Go to the users table
- Find your user account
- Change the user_nicename field to a username/slug format i.e. no spaces, lowercase
- Save the changes
- You’ll now see that your author page starts to work and the error message goes away
Why do this?
I only set this up to test this feature out. It’s quite cool but extremely limited as it creates a Fediverse presence for your site with little to no control. From what I can tell it registers your site domain as a Fediverse server to give you a unique presence.
The following is all missing:
- option to modify a post once it’s published
- specify hashtags to include (very useful on Mastodon)
- personalise your profile directly
- receive notifications for any engagement with your content i.e. replies and favourites
- changing your Fediverse address
The Fediverse address, it’s always @[email protected] which isn’t a particularly appealing good name in this world of vanity usernames. For profiles it will pick up your profile picture from the user account, so you can modify that. Perhaps it picks up additional fields from your WordPress user profile but I haven’t explored that far.
I made a post that I published without setting the category, so the URL includes the ‘uncategorized’ slug. After fixing this mistake, there was no way to go back and change the automatic post it’s pushed out on the Fediverse feed.
Alternative Approaches
- An easy option is to create a Fediverse account on an existing Mastodon server. Then connect your blog to push to this account using the API via a plugin, or via the RSS feed
- Setup your own Mastodon server so you can use your own server address instead of a general one, and then use that to push the same way as above
- Explore Friendica which seems to have the option of making RSS Feeds into Fediverse accounts
My preferred option is Option 1, and perhaps at a later date when I have the time to setup my own server, I would migrate the account to that server. It provides the most control and personalisation and means you can use the Mastodon app to engage with readers.