Client library for sending webmention and pingback notifications

Installs: 114

Dependents: 0

Stars: 29

Watchers: 7

Forks: 13

Open Issues: 3

0.4.7 2015-04-03 11:21 UTC


Client library for sending webmention and pingback notifications.

Build Status


$client = new IndieWeb\MentionClient($url);
$sent = $client->sendSupportedMentions();

echo "Sent $sent mentions\n";

This will find all absolute links on the page at $url and will attempt to send mentions to each. This is accomplished by doing a HEAD request and looking at the headers for supported servers, if none are found, then it searches the body of the page.

After finding either pingback or webmention endpoints, the request is sent to each.

Selectively sending Webmentions

If you want to send mentions for just the links inside your post content, you can pass in a chunk of HTML to parse instead of having this client fetch the HTML from your page.

   $client = new IndieWeb\MentionClient($url, $html);
   $sent = $client->sendSupportedMentions();

In this case, no initial GET request is made to your $url, instead, the HTML passed in to the function is parsed for all absolute <a> tags.

Simple Usage Example

If you know the WebMention or Pingback endpoint already, and just want to use this class to send the payload, you can use the static methods provided.

IndieWeb\MentionClient::sendWebmention($endpoint, $source, $target);

IndieWeb\MentionClient::sendPingback($endpoint, $source, $target);


If you want to accept pingbacks on your site, check out which handles accepting the XMLRPC request and exposes the data via an API.


To learn more about Webmention, see

The service can also act as a pingback->webmention proxy which will allow you to accept pingbacks as if they were sent as JSON webmentions.


Copyright 2013 by Aaron Parecki

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.