A Twitter-like widget of fediverse posts in WordPress via RSS

At the time being people flee Twitter and open Mastodon accounts due to Elon Musk’s support of far-right users on Twitter which deteriorates the common user experience by far. Often people have a small timeline displaying their own tweets on their blogs that will loose its function if they abandon Twitter. This is usually done through a widget which loads some JavaScript from Twitter servers.

A screenshot of my webpage showing the widget of the plugin “Easy Twitter Feeds” in action (12/25/2022)
A screenshot of my webpage showing the widget of the plugin Easy Twitter Feeds in action (12/25/2022)

As far as I know there isn’t such a plugin for Fediverse clients like Mastodon or Friendica (which I use). But those provide RSS feeds for specific accounts. From a technically point of view these feeds are easy to embed in your wordpress via a widget. You even don’t need a plugin for that. But as the devil is in the details there rises a big issue. This widget usually display the title of the feed item. But social ´media posts don’t have in most cases. The in-build RSS widget simply prints a standard text (“feed item”). Of course this is absolutely pointless. I have played around with some plugins and ended up with the following solution:

Available blocks of the Feedzy RSS Feeds Lite plugin.

I took the plugin Feedzy RSS Feeds Lite which allows for some advanced styling of the feed items. In the frontend’s widget menu it provides two blocks: one with a widget icon and one with a RSS icon. Take the first one and put it in your sidebar. You have the option to show a title and/or a description with a certain amount of characters. The are two differences between title and decription:

  • The title ist taken from the first line of a post if there is none in the source. The description is taken from the entire post.
  • The title is linked to the original post while the description is not.

I disabled the description by setting the character number to zero. For the title I choose a length of 80 characters. This is not perfect but leads to reasonable results. If your web server delivers a Conten-Security-Policy header (and it should!) you have to allow for your fediverse domain as image source otherwise images get blocked.

Feedzy widget displays Ingram Braun's Friendica feed in sidebar.

There is an additional benefit for users in the European Union which have to obey the GDPR: there is no traffic to servers in the US anymore.

A Twitter-like widget of fediverse posts in WordPress via RSS 1

Ingram Braun

Archaeologist, web developer, proofreader


Leave a Reply

Your email address will not be published. Required fields are marked *

Post comment