WP Manifestindependent plugin directory
manifest / social / wordpress-to-mastodon-simple-post

WP to Mastodon Auto Poster

Automatically posts to Mastodon when a WordPress post is published.

by Pavel Janíček · github.com/pavel-janicek/wordpress-to-mastodon-simple-post

1stars
0forks

Install

No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:

wp plugin install https://github.com/pavel-janicek/wordpress-to-mastodon-simple-post/archive/refs/heads/main.zip

Readme

WP to Mastodon Auto Poster

A lightweight WordPress plugin that automatically posts to Mastodon whenever a new post is published.
It sends the post title and permalink to your Mastodon account using the Mastodon API.

Features

  • Automatically posts to Mastodon when a WordPress post is published
  • Simple configuration via WordPress admin (no editing files)
  • Stores Mastodon instance URL and access token in plugin settings
  • No external libraries required
  • Minimalistic and easy to modify

Installation

1. Upload the plugin

Create a new folder inside your WordPress installation:

wp-content/plugins/wp-to-mastodon-auto-poster/

Inside that folder, create the main plugin file:

wp-to-mastodon-auto-poster.php

Paste the plugin code into that file.

Alternatively, zip the folder and upload it via
WordPress Admin → Plugins → Add New → Upload Plugin.


Configuration

The plugin now includes a settings page in the WordPress admin.

1. Open the settings page

Go to:

Settings → Mastodon Auto Poster

2. Enter your Mastodon credentials

You will see two fields:

  • Mastodon instance URL
    Example: https://mastodon.social

  • Access token
    A token with permission write:statuses

How to get your Mastodon access token

  1. Log in to your Mastodon instance
  2. Go to Preferences → Development → New Application
  3. Create a new app with permission:
    • write:statuses
  4. Copy the Access Token
  5. Paste it into the plugin settings page

Activation

  1. Log in to your WordPress admin panel
  2. Go to Plugins → Installed Plugins
  3. Find WP to Mastodon Auto Poster
  4. Click Activate

How It Works

When a WordPress post is published:

  • The plugin hooks into the publish_post action
  • It builds a message containing the post title and permalink
  • It sends the message to your Mastodon instance via /api/v1/statuses
  • If the request fails, an error is written to the WordPress debug log

Only standard posts (post post type) trigger the auto‑posting.


Troubleshooting

Nothing is posted to Mastodon

  • Verify your access token is correct
  • Ensure the token has the write:statuses permission
  • Check that your Mastodon instance URL is valid
  • Look at the WordPress debug log for error messages

Plugin activates but does nothing

  • Make sure you are publishing a post, not a page or custom post type
  • Confirm the plugin settings are filled in

Read the full README on GitHub →