Enabling ActivityPub on WordPress

Enabling ActivityPub on WordPress

WordPress has a plugin called ActivityPub, which enables ActivityPub support. This allows Mastodon, Misskey, and other users on the Fediverse to follow your blog for new posts and even comment using their existing Mastodon/Misskey/etc account without filling out a comment form details. The Fediverse is known for generating a lot of interactions, and you may see more comments as a result.

It's recommend to boost your posts with a Mastodon account as most servers will not know about your blog's Fediverse account.

You can also bridge your blog's ActivityPub account to BlueSky, so that opt-in BlueSky users can also follow and comment on your blog posts. See Bridging Bluesky with your WordPress Fediverse Account for details.

Don't have an account on the Fediverse yet? You can click the Mastodon or Misskey links on the navigation bar to get an account.

Getting Started​


For Wordpress.com users, you can enable this by following these instructions.

For self hosted WordPress, it will take more steps to enable this. Install and activate the following plugins in the plugin section.:

Lastly, you should enable Authorized Fetch, so users can follow and see your boosted posts on Fediverse instances that have this enabled. Add the following to wp-config.php (above the /* That's all, stop editing! Happy blogging. */ line)

Code:
define( 'ACTIVITYPUB_AUTHORIZED_FETCH', true );

If you are using W3 Total Cache or any other page caching plugin, you should add the following to the disallowed user agents for Page Caching, or it won’t function properly:

Paste in the Rejected user agents:
Code:
Akkoma
Catodon
Friendica
Hometown
Firefish
Iceshrimp
Mastodon
Misskey
Pleroma
Sharkey

Never Cache the following pages:
Code:
author\/.+
well-known\/webfinger.+

Here is where you find these settings in W3 Total Cache, other caching plugins will look different.
1729903531886.png


Once enabled, you can follow your blog at @<authorname>@<blog domain> or <specifiedblogusername>@<blog domain>. It's more effective that you follow and boost new posts from your Mastodon/Misskey/etc account so it can reach the most number of users.

Keeping your Blog Safe from Bad Actors​

Without setting a basic moderation list, you may get comments that can contain hateful and extremist content. While you have to approve them before they appear, it's better to not have them appear in the first place.

The Fedinuke list has a list of known bad servers that everyone should block. To add them, copy the contents and paste them to the disallowed comment keys to prevent the worst of the worst servers from seeing your blog posts and interacting with it.

This is located in Settings > Discussion under Disallowed Comment Keys. Should look like this:
1729901834517.png



Changing how your posts look on ActivityPub​

You can change how the posts appear on the Fediverse by going to Settings > ActivityPub. Click the Settings tab.
1729902499901.png


Under post content, you can pick which one you want or customize it to your needs. Here is a sample if you want to set a custom content used by the plugin.

Code:
<p>[ap_title]</p>

<p><a href="[ap_permalink]">[ap_permalink]</a></p>

<p>[ap_hashtags]</p>

It's also recommended to enable hashtag support.

You can modify your profile to edit your biography text. To edit the fields, click Users > Extra Fields. You can manage what fields will appear in your profile.

Add a Follow me on the Fediverse Block/Widget​

You can add a Follow me on the Fediverse Gutenburg block if your theme supports adding blocks to all blog post page. If not, add a Block widget with the following as the Block HTML.
Code:
<!-- wp:activitypub/follow-me {"selectedUser":"<your user id>"} /-->

Your user id refers to your user id, usually 1 if you are the primary user.

Here is what it looks like:
1729903077263.png


Sharing your Blog Post from Activity Pub​

To share your blog posts from your blog's ActivityPub account, follow your blog first from your Mastodon or Misskey account. In the search field, type @<wordpressusername>@<yourblogdomain> and view the profile.

You should have something like this. Follow your blog.
1729900741917.png


When you publish a new post, the post should appear on your home timeline. To share it, click the boost button. Now anyone who is following you can see

1729901208094.png



If anyone comments on your posts on the Fediverse, they will appear in the post's comments, as seen in an example.
1729901494205.png

You need to approve the comments before they appear.

Bridging Bluesky with your WordPress Fediverse Account​


Using the Bluesky Bridge, you can bridge your blog's Fediverse account and make it available on Bluesky.
1. Install the Friends Plugin and activate it.
2. Go to Friends > Add New Friend
3. Specify @bsky.brid.gy@bsky.brid.gy as the site to follow and click Quick Subscribe
1729901137494.png

4. Your blog is now bridged with Bluesky. You can view it at:
https://bsky.app/profile/<username>.<your blog address>.ap.brid.gy

Example:
1729901179620.png


Also, the Friends program allows you to follow other blogs, and use it as an RSS reader. The Friends plugin functionality won't be focused on this guide since it's beyond the scope of this tutorial.

If you are looking for a more traditional, automated option...​


If you just want to share your posts the old way, autosharing post links to Mastodon when you publish a new post, see this guide.
Author
chikorita157
Views
2,030
First release
Last update

Ratings

0.00 star(s) 0 ratings

More resources from chikorita157

Top