rel-edit

From Microformats Wiki
Jump to navigation Jump to search

This article is a stub. You can help the microformats.org wiki by expanding it.

rel=edit is for linking to a page to a URL that a browser can load for the user to edit that page.

Definition

rel=edit can be applied to link or a tags, like so:

<link rel="edit" href="https://example.com/edit/page-name" />
<a rel="edit" href="https://example.com/edit/page-name">Edit this page</a>

A rel=edit parser should look for rel=edit links on the page and take the first one found.

The following query selector could be used to identify a candidate rel=edit link per the above description:

document.querySelector("link[rel=edit], a[rel=edit]")

Use Cases

rel=edit offers a standard way to indicate a page is editable. This relation then be identified by a browser extension or a bookmarklet and used to both infer that a page is editable and point the user to the page they can use to edit a document.

Publishers

Consumers

Prior Art

rel=edit was raised in Bug 19068 “Add rel="edit" to list of defined types” in the W3C public Bugzilla to the WHAT WG:

rel="edit" indicates a link that can be used to edit the current resource, e.g., if it's a wiki. It's been proposed by the Universal Edit Button project <http://universaleditbutton.org/>. That documents a number of sites using either rel="edit", or the older poorly-conceived <link rel="alternate" type="application/x-wiki">:

http://universaleditbutton.org/Universal_Edit_Button#Sites_with_Universal_Editing_Button

Users of rel="edit" include MediaWiki, and therefore Wikipedia. As far as implementation goes, there are extensions written for Firefox, Opera, and Chrome. It seems like potentially useful semantics, although only for a fairly narrow class of sites (wikis and CMSes). I'm pretty sure the level of implementation and deployment exceeds some currently specced rel values, like tag, so I don't see why this shouldn't be in the spec. Are there any specific standards you'd like to see that this doesn't meet?

As of May 10th, 2025, Wikipedia does not publish a rel=edit on the main Edit link on pages, but still publishes the `application/x-wiki` syntax.

The Universal Edit Button extension searches for rel=edit.

rel=alternate type=application/x-wiki

MediaWiki supports the following syntax to indicate that the linked resource lets you edit the current page:

 <link rel="alternate"
   type="application/x-wiki"
   title="Welcome to edit this page!"
   href="wiki?edit=myEditLink"/>

This syntax is parsed by the Universal Edit Button.

Because of its support in the MediaWiki engine, this markup is on Wikipedia pages.

With that said, this syntax does not extend to anchor links, unlike the proposed rel=edit. The rel=alternate syntax means you have to add another tag instead of marking up existing, human-readable text on the page via a rel=edit on an anchor.

rel=edit in Atom

RFC 5023 - The Atom Publishing Protocol describes a rel=edit relation in 11.1 as:

This specification adds the value "edit" to the Atom Registry of Link Relations (see Section 7.1 of [RFC4287]). The value of "edit" specifies that the value of the href attribute is the IRI of an editable Member Entry. When appearing within an atom:entry, the href IRI can be used to retrieve, update, and delete the Resource represented by that Entry. An atom:entry MUST NOT contain more than one "edit" link relation.

rel=EditURI in WordPress

WordPress has support for rel=EditURI. The microformats wiki defines the relation in rel-edituri as:

This relationship is used in Wordpress to denote the location of the xml-rpc gateway that allows external editors to be used.

Here is an example of the syntax:

<link rel="EditURI" type="application/rsd+xml" title="RSD" href="https://example.com">

Background

Many sites offer public editing capabilities for web pages, often for authenticated users, with an approval process, or moderation to review edits. Such editing capabilities are common for wikis and technical documentation websites. For example, Wikipedia pages can be edited.

Every site has its own way of indicating that a page is editable. Among the sites that allow editing there is inconsistency in where edit links are placed and the language used. For example, Wikipedia uses “Edit” whereas the GitHub documentation uses “Make a contribution”.

See Also

  • User:Tantek's brainstorm of a wiki based on static pages and HTTP headers notes:

    a page could link to its editing interface/version/query parameter with a rel link as well, e.g. rel=edit, which has been previously proposed as part of Universal Edit Button: links for AJAX-driven edits but could be used for server-based editing state as well. E.g. href="?edit=1". Again this might be best sent as an HTTP Link Header.

    Emphasis added.