{"id":16497574,"url":"https://github.com/matthiasott/webmention","last_synced_at":"2026-04-01T23:23:16.991Z","repository":{"id":152948660,"uuid":"60383865","full_name":"matthiasott/webmention","owner":"matthiasott","description":"Webmention Plugin for Craft CMS","archived":false,"fork":false,"pushed_at":"2026-03-22T16:07:04.000Z","size":1723,"stargazers_count":46,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-03-23T01:31:29.932Z","etag":null,"topics":["craft","craftcms","indieweb","plugin","webmention"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/matthiasott.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2016-06-03T23:38:21.000Z","updated_at":"2026-03-22T16:02:25.000Z","dependencies_parsed_at":"2025-10-05T11:26:12.011Z","dependency_job_id":"7bd17bdf-28f3-4d1d-8924-ea360fc76310","html_url":"https://github.com/matthiasott/webmention","commit_stats":null,"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"purl":"pkg:github/matthiasott/webmention","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matthiasott%2Fwebmention","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matthiasott%2Fwebmention/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matthiasott%2Fwebmention/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matthiasott%2Fwebmention/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/matthiasott","download_url":"https://codeload.github.com/matthiasott/webmention/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matthiasott%2Fwebmention/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31292888,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-01T21:15:39.731Z","status":"ssl_error","status_checked_at":"2026-04-01T21:15:34.046Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["craft","craftcms","indieweb","plugin","webmention"],"created_at":"2024-10-11T14:44:45.979Z","updated_at":"2026-04-01T23:23:16.982Z","avatar_url":"https://github.com/matthiasott.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\u003cimg src=\"./src/icon.svg\" width=\"100\" height=\"100\" alt=\"Webmention icon in the shape of a W\"\u003e\u003c/p\u003e\n\n\u003ch1 align=\"center\"\u003eWebmention for Craft CMS\u003c/h1\u003e\n\nThis plugin provides a [Webmention](https://www.w3.org/TR/webmention/) endpoint for [Craft CMS](https://craftcms.com) and allows for sending Webmentions to other sites.\n\n**Table of Contents:**\n\n- [Requirements](#requirements)\n- [Installation](#installation)\n- [Receiving Webmentions: The Webmention endpoint](#receiving-webmentions-the-webmention-endpoint)\n- [Sending Webmentions](#sending-webmentions)\n- [Craft Plugin Settings](#craft-plugin-settings)\n- [Features](#features)\n- [Roadmap](#roadmap)\n- [Updating from v0.3](#updating-from-v03)\n- [Thank You!](#thank-you)\n- [License](#license)\n- [Author](#author)\n\n## Requirements\nThis plugin requires Craft CMS 5.6.10 or later.\n\n## Installation\nYou can install this plugin from Craft’s in-app Plugin Store.\n\nGo to the Plugin Store in your project’s Control Panel and search for “Webmention”, then click on the “Install” button in the sidebar.\n\n\u003e [!NOTE]  \n\u003e If you’re updating from Webmention v0.3, [follow these instructions](#updating-from-v03) as well.\n\n## Receiving Webmentions\n\n### The Webmention endpoint\nIn order to receive Webmentions, the Webmention endpoint of your site needs to be discoverable by the server sending the Webmention. So you will need to add the following line in the `\u003chead\u003e` section of your main layout template:\n\n```twig\n\u003clink rel=\"webmention\" href=\"{{ craft.webmention.endpointUrl }}\" /\u003e\n```\n\nAnd/or you can set an HTTP Link header by adding this line to your main layout template:\n\n```twig\n{% header \"Link: \u003c\" ~ craft.webmention.endpointUrl ~ \"\u003e; rel=\\\"webmention\\\"\" %}\n```\n\nThe plugin comes with a „human-friendly“ endpoint that will present a form with input fields for `source` and `target` to users visiting your site’s endoint route. The Twig template for the Webmention endpoint will extend your standard template. Run the following CLI command to copy an example webmention endpoint template into your project’s `templates/` directory:\n\n```sh\nphp craft webmention/example-template\n```\n\nYou can then adjust the template to your needs.\n\n### The `webmention/receive` CLI command\n\nFor testing purposes, or if you want to add webmentions yourself manually, you can use the `webmention/receive` CLI command, which processes the webmention for a given source and target:\n\n```sh\nphp craft webmention/receive \u003csource\u003e \u003ctarget\u003e\n```\n\n### Displaying Webmentions\nTo output all Webmentions for the current *request URL*, you can use the following helper in your templates:\n\n```twig\n{{ craft.webmention.showWebmentions() }}\n```\n\nIf you want full control over the HTML output for Webmentions, you can fetch all Webmentions for the current URL:\n\n```twig\n{% for webmention in craft.webmention.getWebmentions() %}\n  \u003cli\u003e\n    \u003ca href=\"{{ webmention.source }}\"\u003e{{ webmention.authorName }}\u003c/a\u003e:\n    {{ webmention.text }}\n  \u003c/li\u003e\n{% endfor %}\n```\n\nTo fetch all Webmentions for an *element*, you can call `getWebmentions()` on the element:\n\n```twig\n{% for webmention in entry.getWebmentions() %}\n  …\n{% endfor %}\n```\n\nAnd if you want to fetch only Webmentions of a certain type, like comments, likes, or reposts, you can call `getWebmentionsByType()` on the element:\n\n```twig\n{% for webmention in element.getWebmentionsByType('like') %}\n  …\n{% endfor %}\n```\n\n### Eager-loading Webmentions\n\nThe plugin supports eager-loading elements with the following values passed into the `with` param:\n\n- `webmentions`\n- `webmentions:\u003ctype\u003e` (e.g. `webmentions:like`)\n\n```twig\n{% set entries = craft.entries()\n  .section('blog')\n  .with(['webmentions:like', 'webmentions:comment'])\n  .all() %}\n```\n\nWith that in place, calling `element.getWebmentions()` or `element.getWebmentionsByType()` will return the eager-loaded webmentions, rather than querying for them for each individual element.\n\nIf all you want to do is output the total, you can set the `with` path’s criteria to `{count: true}`:\n\n```twig\n{% set entries = craft.entries()\n  .section('blog')\n  .with([\n    ['webmentions:like', {count: true}],\n    ['webmentions:comment', {count: true}],\n  ])\n  .all() %}\n```\n\nAlternatively, you can use the  `element.getTotalWebmentions()` and `getTotalWebmentionsByType()` methods to output the total. Both methods support eager-loading as well.\n\n### Display a Webmention form for the current URL\nYou can output a form in your entry template that lets people directly send you the URL of a response.\nFor this, use this helper:\n\n```twig\n{{ craft.webmention.webmentionForm() }}\n```\n\n## Sending Webmentions\nOnce installed, your Craft site will automatically send Webmentions to other sites. On every save of a published entry, the plugin scans the complete entry for any occurrences of URLs and then sends Webmentions to the corresponding Webmention endpoints.\n\n### Sending Webmentions for certain entry types only\nBy default, Webmentions are sent for all entry types but you can also restrict this to certain entry types. Please make sure to go to the settings page of the plugin and select for which entry types Webmentions should be sent.\n\n### Switching Webmentions on/off for individual entries\nThere may be times you want to disable the Webmentions sending functionality on a per-entry basis. This can be accomplished by adding a new “Webmention Switch” field to the field layout of an Entry Type.\n\n![Screenshot showing the creation of a new field](screenshots/field-settings.png)\n\nYou are now able to switch Webmention sending on or off for individual entries! \n\n![Screenshot of the new field in the control panel](screenshots/field.png)\n\n**This setting overrides the Entry Type-specific settings from the settings page.** So if you, for example, disable Webmentions for an Entry Type, you can still send them for individual entries by installing the magic switch. ;)\n\n## Craft Plugin Settings\n\nWebmention settings can be accessed from **Settings** → **Webmention**.\n\n![Screenshot showing the Webmention plugin settings](screenshots/plugin-settings.png)\n\nYou can change the following options:\n\n* **Webmention Endpoint Route (Slug)**    \nSet the URL slug of your Webmention endpoint. Defaults to `webmention`, but you can insert anything that makes sense to you.\n\n* **Maximum Length of Webmention Text**    \n  Set the maximum character count for summaries, comments and text excerpts from posts. Default: `420`\n\n* **Parse Brid.gy Webmentions**    \nToggle if you want the plugin to parse [Brid.gy](https://brid.gy) Webmentions.\n\n* **Avatar Location**     \nThe plugin saves user photos (avatars) for incoming Webmentions for better performance and to avoid exploits. You can set the volume and subfolder path where user avatars will be stored.\n\n* **Entry Types**    \nLets you select all entry types for which you want to send Webmentions. When new entry types are added, they are set to “send Webmentions” by default.\n\n## Features\n\n### Receiving Webmentions\n\nWhen the plugin receives a Webmention, it performs several checks and then parses the source’s HTML with both [php-mf2](https://github.com/indieweb/php-mf2), a generic [microformats-2](http://microformats.org/wiki/microformats-2) parser, and Aaron Parecki’s [php-comments helper](https://github.com/indieweb/php-comments), which returns author info as well as truncated post text for an [h-entry](http://indiewebcamp.com/h-entry). The plugin will try to get all attributes for the data model from the parsed h-entry and also the representative h-card. If no user photo is provided, it will also try to get one from Gravatar as a fallback, using the author’s email from the h-card.\n\nThe following attributes are looked up:  \n\n* `authorName`\n* `authorPhoto`\n* `authorUrl`\n* `published`\n* `name`\n* `text`\n* `target`\n* `source`\n* `hEntryUrl`\n* `host`\n* `type`\n* `properties`\n\nLastly, the Webmention record is saved to the database. Already existing Webmentions (which is determined by a comparison of the `source` and `target` of the POST request) are updated in the database.\n\n### XSS Protection\nTo prevent Cross Site Scripting (XSS) attacks, the HTML of the source is purified with HTMLPurifier, which “removes all malicious code with a thoroughly audited, secure yet permissive whitelist”.\n\n### Bridgy\n\nYou can use [Bridgy](https://brid.gy) for receiving Webmentions for posts, comments, reposts, likes, etc. from Mastodon, Bluesky, GitHub, Reddit, Instagram, Flickr, and more. This plugin will understand the Webmention and set the `type` of the Webmention accordingly. So if someone reposts a social media post with a URL you shared, the Webmention will be of the type `repost`. To determine the interaction type, the plugin looks at the Bridgy URL format, for more information on the different types of URLs visit [the section about source URLs on the Bridgy website](https://brid.gy/about#source-urls).\n\nIf you don’t use Bridgy you can easily deactivate the parsing in the plugin settings.\n\n### HTTP Responses\n\nThe Webmention plugin validates and processes all requests **asynchronously** via [Craft queue jobs](https://craftcms.com/docs/5.x/extend/queue-jobs.html). This guarantees that your site remains responsive, even when a larger amount of webmention requests needs to be handled. Because the webmention processing happens asynchronously, the only direct HTTP response sent by the plugin is a confident **202 Accepted** status code.\n\n## Roadmap\n- Add a more GDPR-friendly “data economy mode” that collects webmentions from Bridgy and other social media sources without saving names and avatars but still allows for showing the *amount* of likes, reposts, etc.\n- Improve how replies are handled and displayed, for example in a chat-like conversation in response to a post.\n\n## Updating from v0.3\nTo update from Webmention 0.3 on Craft 2, do the following after upgrading Craft CMS:\n\n1. Follow the [installation instructions](#installation).\n2. Go to **Settings** → **Webmention** and select the volume that avatars are stored in, from the **Avatar Location** setting.\n3. Run the following CLI command to update your existing webmentions’ avatar relations:\n   ```sh\n   php craft webmention/update-avatars\n   ```\n4. Run the following CLI command to update search indexes for existing webmentions:\n   ```sh\n   php craft resave/webmentions --update-search-index\n   ```\n5. Update your templates based on the following changes:\n\n   Old | New\n   -------- | --------\n   `webmention.author_name` | `webmention.authorName`\n   `webmention.author_url` | `webmention.authorUrl`\n   `webmention.author_photo` | `webmention.avatar.getUrl()`\n   `webmention.url` | `webmention.hEntryUrl`\n   `webmention.site` | `webmention.host`\n   `craft.webmention.getAllWebmentionsForEntry(craft.request.url)` | `craft.webmention.getWebmentions()`\n   `craft.webmention.showWebmentions(craft.request.url)` | `craft.webmention.showWebmentions()`\n   `craft.webmention.webmentionForm(craft.request.url)` | `craft.webmention.webmentionForm()`\n\n\n\u003e [!NOTE]  \n\u003e If you have any webmentions which contain double-encoded HTML entities, you can update them via the “Update” action in the UI, or with the following command:\n\u003e\n\u003e ```sh\n\u003e php craft webmention/update --webmention-id=123\n\u003e ```\n\n## Thank You!\nThanks to everyone who helped setting this up:\n– [Jason Garber](https://sixtwothree.org/) (@jgarber) for his [webmention client plugin](https://github.com/jgarber623/craft-webmention-client) and the kind permission to reuse parts of the code when implementing the sending functionality.\n- [Aaron Parecki](https://aaronparecki.com/) (@aaronpk) for support and feedback – and also for the great work he does related to Webmention.\n- [Bastian Allgeier](http://bastianallgeier.com) (@bastianallgeier) for allowing me to get highly inspired by his [Kirby Webmentions Plugin](https://github.com/bastianallgeier/kirby-webmentions)\n- [Tom Arnold](https://www.webrocker.de/) (@webrocker) for relentlessly sending test Webmentions. ;) Also for feedback on Webmention sending settings.\n- [Jeremy Keith](https://adactio.com) (@adactio) for the feedback and also for giving the initial spark.\n- Everyone at the IndieWebCamps Düsseldorf and Berlin 2016 and in the IndieWeb Community!\n- [Brandon Kelly](https://brandonkelly.io) for basically rewriting the plugin to add support for Craft 5 and a lot more 🔥🎉\n\n## License\n\nCode released under [the MIT license](https://github.com/matthiasott/webmention/LICENSE).\n\n## Authors\n\nMatthias Ott   \n\u003cmail@matthiasott.com\u003e  \n\u003chttps://matthiasott.com\u003e\n\nBrandon Kelly   \n\u003cbrandon@pixelandtonic.com\u003e   \n\u003chttps://brandonkelly.io\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatthiasott%2Fwebmention","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmatthiasott%2Fwebmention","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatthiasott%2Fwebmention/lists"}