
{"id":2003,"date":"2022-11-19T20:57:15","date_gmt":"2022-11-19T20:57:15","guid":{"rendered":"https:\/\/opendna.com\/blog\/?p=2003"},"modified":"2024-10-13T18:14:49","modified_gmt":"2024-10-13T18:14:49","slug":"getting-started-with-mastodon-x-wordpress","status":"publish","type":"post","link":"https:\/\/opendna.com\/blog\/2022\/11\/19\/getting-started-with-mastodon-x-wordpress\/","title":{"rendered":"Getting started with Mastodon x WordPress"},"content":{"rendered":"\n<p>If you have a <a href=\"https:\/\/wordpress.org\/\" data-type=\"URL\" data-id=\"https:\/\/wordpress.org\/\" target=\"_blank\" rel=\"noreferrer noopener\">WordPress<\/a> blog and a <a href=\"https:\/\/joinmastodon.org\/\" data-type=\"URL\" data-id=\"https:\/\/joinmastodon.org\/\" target=\"_blank\" rel=\"noreferrer noopener\">Mastodon<\/a> account, the three things you&#8217;re going to want to do are <strong><a href=\"#verify\">verify your identity<\/a><\/strong>, <strong><a href=\"#embed\" data-type=\"internal\" data-id=\"#embed\">embed toots<\/a><\/strong>, and <strong><a href=\"#syndicate\">syndicate your blog<\/a><\/strong> on <a href=\"https:\/\/en.wikipedia.org\/wiki\/Fediverse\" data-type=\"URL\" data-id=\"https:\/\/en.wikipedia.org\/wiki\/Fediverse\" target=\"_blank\" rel=\"noreferrer noopener\">the fedirverse<\/a>.<\/p>\n\n\n\n<a name=\"verify\"><\/a><h2>Verifying Mastodon Identity<\/h2>\n\n\n\n<p>Identity verification in the fedirverse is based upon controlling a property elsewhere on the web.<\/p>\n\n\n\n<p>The most basic version of this is running a Mastodon instance: <a rel=\"noreferrer noopener\" href=\"https:\/\/mastodon.archive.org\/@textfiles\" data-type=\"URL\" data-id=\"https:\/\/mastodon.archive.org\/@textfiles\" target=\"_blank\">@textfiles@mastodon.archive.org<\/a> is certainly Jason Scott at the Internet Archive. (Hosting a Mastodon instance is beyond scope of this post.)<\/p>\n\n\n\n<p>As an alternative, <a rel=\"noreferrer noopener\" href=\"https:\/\/mastodon.sdf.org\/@reuters@newsie.social\/109331038545939169\" data-type=\"URL\" data-id=\"https:\/\/mastodon.sdf.org\/@reuters@newsie.social\/109331038545939169\" target=\"_blank\">@reuters@newsie.social can prove<\/a> they are an authorized account of Reuters news service by inserting code on <em>Reuters.com<\/em>. There are three ways to do this.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Option 1: Edit Theme Metadata<\/h3>\n\n\n\n<p>Insert <code>&lt;link rel=\"me\" href=\"https:\/\/{host}\/@{user}\"&gt;<\/code> between the <code>&lt;head&gt;&lt;\/head&gt;<\/code> elements in <em>header.php<\/em>. This method is not available to WordPress.com-hosted sites.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Option 2: Social Media Link Blocks<\/h3>\n\n\n\n<p>&#8220;<a rel=\"noreferrer noopener\" href=\"https:\/\/www.tindrasgrove.com\/2022\/11\/mastodon-wordpress-and-verification\/\" data-type=\"URL\" data-id=\"https:\/\/www.tindrasgrove.com\/2022\/11\/mastodon-wordpress-and-verification\/\" target=\"_blank\">Mastodon, WordPress, and Verification<\/a>&#8221; by <a rel=\"noreferrer noopener\" href=\"https:\/\/infosec.exchange\/@TindrasGrove\" data-type=\"URL\" data-id=\"https:\/\/infosec.exchange\/@TindrasGrove\" target=\"_blank\">@TindrasGrove@infosec.exchange<\/a> demonstrates a step-by-step to using post-<a rel=\"noreferrer noopener\" href=\"https:\/\/wordpress.org\/support\/article\/blocks\/\" data-type=\"URL\" data-id=\"https:\/\/wordpress.org\/support\/article\/blocks\/\" target=\"_blank\">Gutenberg blocks<\/a> to add a Mastodon verification link. This method <em>should<\/em> be compatible with WordPress.com-hosted sites using modern themes.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Option 3: A Verification plugin<\/h3>\n\n\n\n<p>I didn&#8217;t see a plugin for mastodon verification so I wrote one. It&#8217;s on <a href=\"https:\/\/github.com\/mckinnon\/simple-mastodon-verification\" data-type=\"URL\" data-id=\"https:\/\/github.com\/mckinnon\/simple-mastodon-verification\" target=\"_blank\" rel=\"noreferrer noopener\">github: simple-mastodon-verification<\/a> and <a href=\"http:\/\/wordpress.org\/plugins\/simple-mastodon-verification\" data-type=\"URL\" data-id=\"http:\/\/wordpress.org\/plugins\/simple-mastodon-verification\" target=\"_blank\" rel=\"noreferrer noopener\">wordpress.org: simple-mastodon-verification<\/a>. It makes Option 1 accessible to WordPress.com-hosted sites by inserting a form field on the <em>General Settings<\/em> menu. This method should be compatible with WordPress.com-hosted sites, but free plugins require a &#8220;Business Plan&#8221; upgrade.<\/p>\n\n\n\n<a name=\"embed\"><\/a><h2>Embed Toots in Blog Posts<\/h2>\n\n\n\n<p><a rel=\"noreferrer noopener\" href=\"https:\/\/mastodon.social\/@jynersolives\" data-type=\"URL\" data-id=\"https:\/\/mastodon.social\/@jynersolives\" target=\"_blank\">@jynersolives@mastodon.social<\/a> and <a rel=\"noreferrer noopener\" href=\"https:\/\/mastodon.social\/@ThetaSigma@fandom.ink\" target=\"_blank\">@ThetaSigma@fandom.ink<\/a> asked &#8220;is <a rel=\"noreferrer noopener\" href=\"https:\/\/mastodon.social\/@jynersolives\/109346563855527542\" data-type=\"URL\" data-id=\"https:\/\/mastodon.social\/@jynersolives\/109346563855527542\" target=\"_blank\">there a good way to embed Toots on a WordPress<\/a> website?&#8221; Short answer: no. Either use screenshots and link to the source, or embrace <a rel=\"noreferrer noopener\" href=\"https:\/\/mastodon.social\/@Gargron\" data-type=\"URL\" data-id=\"https:\/\/mastodon.social\/@Gargron\" target=\"_blank\">@Gargron@mastodon.social<\/a>&#8216;s <a rel=\"noreferrer noopener\" href=\"https:\/\/mastodon.social\/@Gargron\/99662106175542726\" data-type=\"URL\" data-id=\"https:\/\/mastodon.social\/@Gargron\/99662106175542726\" target=\"_blank\">&#8220;no quote tweets&#8221; philosophy<\/a>.<\/p>\n\n\n\n<p>The &#8220;WordPress Way&#8221; is to take the public URL of the Toot provided (not the one loaded from <em>your<\/em> own Instance) and paste into a Block to take advantage of WordPress&#8217; built-in iframe wrap: click <em>Share<\/em> &gt;<em>Copy Link<\/em> and paste into WordPress. You&#8217;ll be rewarded with a 1000px-tall iframe and Console errors about violating the <a rel=\"noreferrer noopener\" href=\"https:\/\/content-security-policy.com\/unsafe-inline\/\" data-type=\"URL\" data-id=\"https:\/\/content-security-policy.com\/unsafe-inline\/\" target=\"_blank\">Content Security Policy directive about unsafe inline content<\/a>.<\/p>\n\n\n\n<p>The WordPress kludge is to use an HTML block. If you are logged-in to Mastodon, you can get iframe embed code by clicking the More option (&#8220;&#8230;&#8221;) at the bottom right of a toot and selecting &#8220;embed&#8221;. While the supplied iframe code will be accepted by WordPress, and the dimensions of the embed code can be changed, it will return a &#8220;This block contains unexpected or invalid content&#8221; error.<\/p>\n\n\n\n<p>The long and short of it is that iframes are dangerous so <a rel=\"noreferrer noopener\" href=\"https:\/\/wordpress.org\/support\/article\/embeds\/\" data-type=\"URL\" data-id=\"https:\/\/wordpress.org\/support\/article\/embeds\/\" target=\"_blank\">WordPress has a list of approved sites for embeds<\/a>. Because of the federated nature of Mastodon \u2014 and the fediverse \u2014 few (if any) instances will ever be on that list. The dimensions of the iframe are hard-coded in the WordPress Core; while a plugin or JS hack could correct them, neither presently exist (nor should they).<\/p>\n\n\n\n<p>If you feel compelled to embed Toots, I suggest using screenshots and link to the source. Remember: your embeds will 404 when instances shut down, and when users auto-purge their timelines. (Just don&#8217;t forget the alt-text.)<\/p>\n\n\n\n<a name=\"syndicate\"><\/a><h2>Syndicate Your Blog on Mastodon<\/h2>\n\n\n\n<p><a rel=\"noreferrer noopener\" href=\"https:\/\/mastodon.social\/@pfefferle\" data-type=\"URL\" data-id=\"https:\/\/mastodon.social\/@pfefferle\" target=\"_blank\">@pfefferle@mastodon.social<\/a> published the <a rel=\"noreferrer noopener\" href=\"https:\/\/wordpress.org\/plugins\/activitypub\/\" data-type=\"URL\" data-id=\"https:\/\/wordpress.org\/plugins\/activitypub\/\" target=\"_blank\">ActivityPub plugin<\/a>, which implements the protocol for WordPress blogs. When enabled (<a rel=\"noreferrer noopener\" href=\"https:\/\/github.com\/pfefferle\/wordpress-activitypub\/compare\/master...mckinnon:wordpress-activitypub:master\" data-type=\"URL\" data-id=\"https:\/\/github.com\/pfefferle\/wordpress-activitypub\/compare\/master...mckinnon:wordpress-activitypub:master\" target=\"_blank\">some .htaccess modification<\/a> may be required), WordPress will respond to <a rel=\"noreferrer noopener\" href=\"https:\/\/webfinger.net\/\" data-type=\"URL\" data-id=\"https:\/\/webfinger.net\/\" target=\"_blank\">Webfinger<\/a> requests for users (user@domain) and be discoverable and followable by Mastodon users. It&#8217;s worth noting that the ActivityPub feed is <em>per-user<\/em> (<a rel=\"noreferrer noopener\" href=\"https:\/\/wordpress.org\/support\/topic\/is-an-author-page-necessary\/\" data-type=\"URL\" data-id=\"https:\/\/wordpress.org\/support\/topic\/is-an-author-page-necessary\/\" target=\"_blank\">using Author pages<\/a>), not sitewide, so <a rel=\"mention\" class=\"u-url mention\" href=\"https:\/\/opendna.com\/blog\/author\/blog\/\">@blog<\/a> does not report everything published by all users on opendna.com. (This has some interesting potential for using WP authors to create topical feeds, or only advertise some posts.)<\/p>\n\n\n\n<p><em>(Note: There is <a rel=\"noreferrer noopener\" href=\"https:\/\/wordpress.org\/support\/topic\/approve-follow-request-redux\/\" data-type=\"URL\" data-id=\"https:\/\/wordpress.org\/support\/topic\/approve-follow-request-redux\/\" target=\"_blank\">a known glitch<\/a> with following a WordPress x ActivityPub site, in which results in &#8220;request pending&#8221; for Follow requests<\/em>.<em>)<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you have a WordPress blog and a Mastodon account, the three things you&#8217;re going to want to do are verify your identity, embed toots, and syndicate your blog on the fedirverse. This post briefly describes how to do all three.<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"webmentions_disabled_pings":false,"webmentions_disabled":false,"activitypub_content_warning":"","activitypub_content_visibility":"","activitypub_max_image_attachments":3,"activitypub_interaction_policy_quote":"anyone","activitypub_status":"federate","footnotes":""},"categories":[190],"tags":[205,206,138,627,207],"class_list":["post-2003","post","type-post","status-publish","format-standard","hentry","category-builds","tag-diyhost","tag-fediverse","tag-howto","tag-mastodon","tag-wordpress"],"_links":{"self":[{"href":"https:\/\/opendna.com\/blog\/wp-json\/wp\/v2\/posts\/2003","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/opendna.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/opendna.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/opendna.com\/blog\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/opendna.com\/blog\/wp-json\/wp\/v2\/comments?post=2003"}],"version-history":[{"count":25,"href":"https:\/\/opendna.com\/blog\/wp-json\/wp\/v2\/posts\/2003\/revisions"}],"predecessor-version":[{"id":2331,"href":"https:\/\/opendna.com\/blog\/wp-json\/wp\/v2\/posts\/2003\/revisions\/2331"}],"wp:attachment":[{"href":"https:\/\/opendna.com\/blog\/wp-json\/wp\/v2\/media?parent=2003"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/opendna.com\/blog\/wp-json\/wp\/v2\/categories?post=2003"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/opendna.com\/blog\/wp-json\/wp\/v2\/tags?post=2003"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}