Include Mastodon Feed


Tillägg som tillhandahåller kortkoden [include-mastodon-feed] för att enkelt integrera Mastodon-flöden på WordPress-sidor.

Tillägget är skrivet i PHP och skapar JavaScript för att hämta och visa Mastodon-flödet. Inga speciella bibliotek behövs.


  1. Upload the ”include-mastodon-feed” directory to the ”/wp-content/plugins/” directory.
  2. Activate the plugin through the ”Plugins” menu in WordPress.
  3. Insert shortcode into any page.

Shortcode example

[include-mastodon-feed instance="YOUR-INSTANCE" account="YOUR-ACCOUNT-ID"]

Shortcode attributes

  • account (required)
    The account ID (a long number – see FAQ on how to get it)

  • instance (required)
    Domain name of the instance without https:// (e.g.

  • limit
    Maximum number of statuses (Default: 20)

  • excludeReplies
    Exclude replies to other accounts (Default: false)

  • excludeConversationStarters
    Exclude statuses that start with a user mention (Default: false)

  • excludeBoosts
    Exclude boosted statuses (Default: false)

  • onlyPinned
    Show only pinned statuses (Default: false)

  • onlyMedia
    Show only statuses containing media (Default: false)

  • tagged
    Show only statuses that are tagged with given tag name (Default: false)
    No leading #, case insensitive, e.g.: tagged=”tagname”

  • linkTarget
    Target for all links e.g. new tab would be ”_blank” (Default: _self)

  • showPreviewCards
    Show preview cards (Default: true)

  • darkmode
    Enable dark mode (Default: false)

  • text-loading
    Loading text (Default: Loading Mastodon feed…)

  • text-noStatuses
    Text if no statuses are available (Default: No statuses available)

  • text-boosted
    Text indicating boosted statuses (Default: boosted 🚀)

  • text-viewOnInstance
    View status on instance link text (Default: view on instance)

  • text-showContent
    Text for content warning buttons (Default: Show content)

  • text-permalinkPre
    Text before post permalink (date & time) (Default: on)

  • text-permalinkPost
    Text after post permalink (date & time) (Default: )

  • text-edited
    Text indicating edited posts (Default: (edited))

  • date-locale
    Locale for date string, used in toLocaleString() (Default: en-US)

  • date-options
    Format options directly fed into toLocaleString() (Default: {})

Additional customizations

You can define several plugin constants to set custom default options that will be applied site-wide.

  1. Open your wp-config.php file
  2. Sök efter raden /* Add any custom values between this line and the "stop editing" line. */
  3. Define the options you want to override between the line from step #2 and /* That's all, stop editing! Happy publishing. */

See the included config-example.php file for a full list of supported settings.

Vanliga frågor

How do I find my account ID?

As an instance admin you can easily read your user ID in the admin backend.

As regular user you can try an API v2 search to find your ID.

API v2 notes:
* You might have to be logged in to get any results
* Change to your instance
* Replace username with your handle.

Use the following URL to get your ID:

Known Issues / Todo

  • improve support for video and audio media attachment types
  • integrera i18n med istället för textkonstanter
  • re-build plugin as custom gutenberg block


11 november 2023
thanks a lot! Works charming ...
26 juli 2023
Simple installation, perfect description, user ID in seconds, minimal customization. This plugin just does what it should do.
12 juli 2023
The instructions look a bit intimidating to start with, but it's actually pretty simple to install and configure. The FAQ tells you how to find your account number, and there are plenty of shortcode options to customise the feed.
16 juni 2023 8 svar
Overall this is fantastic and offers some easy to use customizations with shortcode. Well done, thank you!!The only thing I'd like to see in the future is the ability to exclude @'s to other users. You can already disable replies which is great, but I'd like to suppress conversations I start with other users.
Läs alla 12 betyg

Bidragsgivare och utvecklare

”Include Mastodon Feed” är programvara med öppen källkod. Följande personer har bidragit till detta tillägg.

Bidragande personer

”Include Mastodon Feed” har översatts till 2 språk. Tack till översättarna för deras bidrag.

Översätt ”Include Mastodon Feed” till ditt språk.

Intresserad av programutveckling?

Läs programkoden, kika på SVN-filförvaret eller prenumerera på utvecklarloggen via RSS.



  • fix: improved excludeConversationStarters detection (did not work correctly)
  • fix: undid last refactor to load JS inline with markup instead footer to fix problem with JS that was added to footer even if shortcode was not visibly rendered


  • fix: style for embedded videos / GIFs
  • refactor: play gifv on mouseover
  • refactor: load markup related javascript in footer instead of embedding it directly with the html markup


  • omfaktorering: visa meningsfulla meddelanden om inga statusuppdateringar är tillgängliga
  • fix: broken excludeConversationStarters logic


  • added option to exclude conversation starters (posts that start with a user mention)


  • fix: boolean param validation was wonky
  • fix: stop links from overflowing (thanks to for contributing)
  • refactoring: improved styling of embedded images


  • lade till inställning för att visa/dölja förhandsvisningskort
  • omfaktorering: introducera namnrymd för tillägget
  • omfaktorering: förbättra utdata på felsökningskonsolen


  • höjde WordPress-versionen till 6.2
  • added option to customize permalink text (before and after date/time)
  • added option to customize text indicating edited posts


  • image attachments are now clickable (link to original status)


  • added option to show only statuses with specific tag
  • added option to set link target to make links open in new tab
  • lade till inställning för att ange maximalt antal statusuppdateringar


  • fixade stilproblem med emojis i kontots visningsnamn


  • fixade stilproblem med boostade kontolänkar


  • removed ”view on instance” link and made date info clickable instead
  • added custom date locale and format option
  • fixade stilproblem för emoji och inbäddade länkar i innehållsblock
  • fixed an issue with gifv media attachments
  • refactored option sanitizing and filtering


  • updated documentation that plugin constants for setting custom default options have to be defined in wp-config.php, as the previous config.php file gets removed with every automatic plugin update
  • tog bort stöd för config.php


  • lade till nya flödes-inställningar: excludeReplies, onlyPinned, onlyMedia


  • fixade trasig JavaScript om inlägg innehåller andra mediabilagor än bilder
  • fixed custom ”view on instance” option
  • lade till inställning för att skräddasy texten på innehållsvarningsknappen
  • added option to exclude boosted statuses
  • added support for gifv media attachments


  • added support for more custom text overrides (loading, boosted, view on instnace)
  • ändrade till att visa statiska avatarer, animerade avatarer endast vid hovring


  • escaped options when echoing them
  • säkrade inkludering av lokala filer
  • ändrade versionering till semantiska versionsnummer – innehåller nu ett patchnummer


  • Första utgåvan