How to embed Mastodon posts on a website or blog

You can embed posts from Mastodon on your own website, blog or other platform that lets you post HTML code. Here’s how to do it:

  1. Log in through your server’s website or the web app
  2. Go to the post or reply you want to embed and click on it to show the enlarged view of that post
  3. Click ⋯ at the bottom of the enlarged post or reply, then select Get embed code
  4. Copy and paste the HTML code into your website’s page code

NOTE: Step 2 above is really important, the embed option may not be visible if the post or reply isn’t enlarged.

What does embedding mean?

Embedding means the post itself will be displayed on the website, and all the post’s interactive elements such as links, images, video, audio etc can be clicked on and will work.

How do I embed Mastodon posts on WordPress sites and blogs?

If you’re using the block editor in WordPress, don’t use WordPress’s “Embed” block. Instead, use WordPress’s “Custom HTML” block and paste Mastodon’s HTML embedding code there.

Alternatively, if you’re editing the page’s code you can paste the embedding code directly.

How is embedding different from posting a screenshot?

Embedding a post means the post itself is displayed. Any edits/updates made to the post will be automatically shown within the embedded post.

Wait what… the post can be edited after I’ve embedded it? What happens if it gets edited into something nasty?

Whenever you embed something on the web, it can be edited after you embed it. This is to do with how embedding works, it’s basically like a little window into the post’s own website.

However, in the particular case of Mastodon, there is a way of making sure you don’t get caught out by malicious edits: if you also boost the post from your Mastodon account, you will be notified if it is ever edited.

Can I embed other people’s posts?

Yes, if they’re public.

Some posts don’t have an “Embed” option. How do I embed them?

Click on the post to switch to the enlarged view of that post, then try clicking ⋯ again.

If you’ve enlarged a post and clicked ⋯ but it still doesn’t have an embed option, it may be a post with restricted visibility. If a post has a restricted visibility, it cannot be embedded because the creator of the post doesn’t want it to be widely seen. You can only embed posts with a public visibility. Alternatively, it may be a post on a platform that doesn’t support embedding.

I embedded a post but it doesn’t look like a Mastodon post any more? It uses some other format?

The post you embedded may be from a different type of Fediverse server. Embedding shows the post in the format used on its own server rather than your server.

Timelines on Mastodon servers show posts from all across the Fediverse. Some of these posts are from other Mastodon servers, but some are from different kinds of servers. For the sake of making timelines easy to read, your Mastodon server will display all posts in the same Mastodon format, but that’s not necessarily how they appear on their own server. If you embed a post from a different kind of server, it will look different when you embed it.

Not every server type supports embedding, and you may sometimes find there is no embed option for their posts even when you’ve done everything correctly.

Is there a way to embed Mastodon feeds rather than just individual posts?

Yes, but they may require additional software or scripts on your website or blog.

Every Mastodon account and hashtag has its own RSS feed, so if your blog supports embedding RSS feeds you can use that feature to embed a Mastodon account or hashtag feed. If the RSS titles don’t display properly (which seems to be a problem sometimes) try a different feed script or add-on.

↩ Back to the front page