Microformats are amazing
Published by W. Developer on
In which I extoll the virtues of using microformats.
Blah blah blah
h-entry is a simple, open format for content on the web. h-entry is often used with content intended to be syndicated, e.g. blog posts. h-entry is one of several open microformat standards suitable for embedding data in HTML.
h-entry is the microformats2 update to hAtom, in particular its "hentry" root class which itself was based on Atom's "entry" element. For an update to "hfeed" see h-feed.
Status
This is a Living Specification yet mature enough to encourage additional implementations and feedback. This specification has portions that are stable, draft, and proposed. Features are stable unless explicitly labeled draft or proposed, or in draft or proposed sections. Draft and proposed features are likely to change substantively. While substantive changes to stable features are unexpected, it is a living specification subject to substantive change by issues and errata filed in response to implementation experience, requiring consensus among participating implementers as part of an explicit change control process.
Participate
Resolved issues before 2012-246
Advance the spec by following explicit change control process
License
Per CC0, to the extent possible under law, the editors have waived all copyright and related or neighboring rights to this work. In addition, as of 2025-04-27, the editors have made this specification available under the Open Web Foundation Agreement Version 1.0.
Here is a simple blog post example:
Published by W. Developer on
In which I extoll the virtues of using microformats.
Blah blah blah
Parsed JSON:
{ "items": [ { "type": [ "h-entry" ], "properties": { "name": [ "Microformats are amazing" ], "author": [ { "value": "W. Developer", "type": [ "h-card" ], "properties": { "name": [ "W. Developer" ], "url": [ "http://example.com" ] } } ], "published": [ "2013-06-13 12:00:00" ], "summary": [ "In which I extoll the virtues of using microformats." ], "content": [ { "value": "Blah blah blah", "html": "
Blah blah blah
" } ] } } ] }The class h-entry
is a root class name that indicates the presence of an h-entry.
p-name, p-author, dt-published and the other h-entry property classnames listed below define properties of the h-entry.
Note: The purpose of an entry is to place it around both the explicitly written content (in the content property or in other specific properties for non-textual content or responses) and whatever else is the context for that content, including properties for when it was published and/or updated, who created it, tags or categorization, and links to what the content is a response to (perhaps with a quoted excerpt) and/or links to syndicated copies.
h-entry properties, inside an element with class h-entry. All properties are both optional and may have multiple instances, e.g. multiple name, url, photo etc. properties.
The following core h-entry properties have broad consensus and are broadly interoperably published and consumed:
p-name
- entry name/titlep-summary
- short entry summarye-content
- full content of the entrydt-published
- when the entry was publisheddt-updated
- when the entry was updatedp-author
- who wrote the entry, optionally embedded h-card(s)p-category
- entry categories/tagsu-url
- entry permalink URLu-uid
- universally unique identifier, typically canonical entry URLp-location
- location the entry was posted from, optionally embed h-card, h-adr, or h-geou-syndication
- URL(s) of syndicated copies of this post. The property equivalent of rel-syndication (example)u-in-reply-to
- the URL which the h-entry is considered reply to (i.e. doesn’t make sense without context, could show up in comment thread), optionally an embedded h-cite (reply-context) (example)p-rsvp
(enum, use element or value-class-pattern) ... <data class="p-rsvp" value="YES">is going</data> to ...
, or ... <data class="p-rsvp" value="Maybe">might go</data> to ...
... <data class="p-rsvp" value="no">unable to go</data> to ...
... <data class="p-rsvp" value="interested">am interested/tracking/watching</data> ...
u-like-of
- the URL which the h-entry is considered a “like” (favorite, star) of. Optionally an embedded h-citeu-repost-of
- the URL which the h-entry is considered a “repost” of. Optionally an embedded h-cite.The following draft properties are in use in the wild (published and consumed), and are under strong consideration, but are not yet part of the core:
u-photo
- one or more photos that is/are considered the primary content of the entry, unless there is a p-location h-card
, which is still considered a "checkin" (i.e. with a photo). Otherwise the presence of a u-photo means the name of the entry should be interpreted as a caption on the photo, and the summary/content should be interpreted as a description of the photo. u-photo
property MUST be on an element that provides a text description for the image (e.g. <img alt="">
) UNLESS the image is already described inside the contents a text property such as p-name
, p-summary
, or e-content
u-video
- special u- parsing rules for <video src> & <source src>
The following properties are proposed additions based on various use-cases, such as existing link preview markup conventions, but are awaiting citations of use across multiple sites in the wild, and at least one reader / real world consuming code example:
u-audio
- special u- parsing rules for <audio src> & <source src>
. Examples: Transportini,possibly more
u-like
- similar to p-comment, URL to a like post of the current post, e.g. in a responses list or facepile.
u-repost
- similar to u-like, URL to a repost of the current post, e.g. in a responses list or facepile.
u-bookmark-of
- indicates this h-entry is a bookmark of another URL. Optionally an h-cite. See indieweb.org/bookmark for examples in the wild.
u-featured
- a representative photo or image for the entry, e.g. primary photo for an article or subject-cropped photo, suitable for use in a link-preview.
p-latitude
- latitude of the location of the entry p-longitude
- longitude of the location of the entry p-altitude
- altitude of the location of the entryp-duration
- duration of an audio or video file in the entry. https://indieweb.org/duration Multiple publishers and consumers in the wild; https://github.com/snarfed/granary/issues/169 more background.
p-size
- size in bytes of an audio or video file in the entry. https://indieweb.org/size Multiple publishers and consumers in the wild; https://github.com/snarfed/granary/issues/169 more background.u-listen-of
- also known as a 'scrobble', indicates this h-entry is a listen of another URL. Optionally an h-cite. https://github.com/microformats/h-entry/issues/11u-watch-of
- indicates this h-entry is a watch of another URL, a visual version of the scrobble. Optionally an h-cite. https://github.com/microformats/h-entry/issues/17p-read-of
- indicates this h-entry is a read post of some written work (book or other document). The value can be the title of the work or an h-cite. Proposal also mentions u-read-of
, where the value would be a URL to the written work or a representative citation page. https://github.com/microformats/h-entry/issues/10u-translation-of
- indicates this h-entry is a translation of the linked URL into another language. Can be used in the same way as the existing u-like-of
and u-repost-of
properties, with just the URL to the original h-entry, or (optionally) contain an embedded h-cite
. https://github.com/microformats/h-entry/issues/26u-checkin
- the URL of the venue/location h-card which the h-entry is considered a “checkin” of. Optionally an embedded h-card. https://github.com/microformats/h-entry/issues/15u-review-of
- the URL which the h-entry is considered a review of, optionally an embedded h-cite, h-card, h-event, or h-item. This could allow retirement of the h-review as unnecessary, in theory.
The following interpretation is also proposed addition:
p-location
is also an embedded h-card, the entry is treated as a "checkin".
Note: As h-entry usage grows to express and consume different kinds of content, we expect additional properties may be proposed and iterated as demonstrated by real-world needs, usage, and interoperability.
How do you add proposed properties and then upgrade them to draft and then core properties?
See: change control
This section is a stub.
p-location
has been re-used from h-event.
p-name
of a note? p-name
to notes. See https://indieweb.org/note for more discussion of the topic.p-location
property value.dt-published
property should be a <time>
element so that you can take advantage of HTML5's "datetime" property. What is the bare minimum list of required properties on an h-entry?
No properties are explicitly required, but in practice a h-entry should have the following properties at a minimum for consumers:
url
published
— if there is no "published" date for the "entry", then reconsider whether it is correct (or worth) marking it up as an entry.What properties should an h-entry have in addition to the bare minimum?
Beyond the bare minimum, a typical h-entry should have the following as well:
content
(or summary
at least) - especially for structured content. For a plain text note, the content/summary (whichever is used) should be the same as the name
, otherwise it will be implied from the text content of the root element.name
- for explicitly named/titled entries like blog posts and articles. Otherwise the entry is assumed to be a "title-less" note (like a tweet).author
- including a nested [h-card](/wiki/h-card "h-card")
with author details like name, photo, url.Real world in the wild examples of sites and services that publish or consume h-entry:
Test and validate microformats2 markup in general with:
Software implementations that publish or consume h-entry, including themes, plugins, or extensions:
(This section is a stub that needs expansion! In practice, nearly every CMS on every indie web site supports publishing h-entry by default.)
When adding an implementation, please provide and link to its home page and open source repo if any.
For backward compatibility with legacy hAtom consuming implementations, use hAtom classnames (or rel values) in addition to the more future-proof h-entry properties, for example:
It was the best of visible tags, it was the alternative invisible tags.
The a tag is perhaps the best of HTML, yet its corresponding invisible link tag has uses too.
ℹ️ Note: Note: you may use any valid HTML5 elements. The article h1 address time
elements are used in the example as semantically richer suggestions, however in general div span
work fine too. The time
element is special though in that its datetime
attribute provides a more author/user friendly way of separating a machine readable ISO8601 datetime from a human readable summary.
The list of equivalent hAtom classnames and rel values is provided below.
Microformats parsers SHOULD detect classic properties only if a classic root class name is found and parse them as microformats2 properties.
If an "h-entry" is found, don't look for an "hentry" on the same element.
Compat root class name: hentry
Properties: (parsed as p- plain text unless otherwise specified):
entry-title
- parse as p-name
entry-summary
- parse as p-summary
entry-content
- parse as e-content
published
- parse as dt-updated
- parse as dt-author
- including compat root vcard
in the absence of h-card
category
rel=bookmark
- parse as u-url
. While not a class name nor typical microformats property, rel=bookmark was the only way to indicate an hentry permalink. Thus parsers should look for rel=bookmark hyperlinks inside an hentry, and take their "href" value as a value for a u-url
property, including handling any relative URL resolution.rel=tag
- parse as p-category
. While not a class name nor typical microformats property, rel=tag was the typical way to tag an hentry. Thus parsers should look for rel=tag hyperlinks inside an hentry, and take the last path segment of their "href" value as a value for a p-category
property.Proposed: (follow-up in issue #7)
time.entry-date[datetime]
- in the absence of published
, parse as dt-published
. parse for the first <time>
element with class name of entry-date
and non-empty datetime
attribute inside an hentry, if there is no published
property, use that time element's datetime
attribute value for the dt-published
property. Evidence: default WordPress themes 2011-2014([1][2][3][4]).rel=author
- in the absence of author
, parse as u-author
. While not a class name nor typical microformats property, rel=author was commonly used to link to an author's URL. Thus parsers should look for rel=author hyperlinks inside an hentry (or even on the same page, preceding the hentry), use the absolute version of it as a value for the u-author
property if there is no "author" property. (citations to "hentry" examples in the wild that depend on rel=author needed to accepted this proposal. Note: default WordPress themes twentyeleven, twentytwelve, twentythirteen, twentyfourteen all use rel=author but only inside class="author vcard", and thus rel=author can be ignored since authorship is already picked up by existing author
backcompat parsing.)Also asked as: Why use an h-entry u-url u-uid for permalinks when I have rel=bookmark?
A: tl;dr: use class="u-url u-uid"
instead of rel=bookmark
for post permalinks because it's simpler (fewer attributes), and works better across contexts (permalink page, recent posts on home page, collection of posts on archive pages).
rel=bookmark was the old hAtom way of marking up permalinks. Since then two factors have contributed to reducing use of rel inside microformats:
* even though rel=bookmark in particular is article-element / sectioning scoped in HTML5[5], it's a detail that typical authors are not going to remember, and thus it's not good to depend on it for any kind of format.
The entry-*
classnames in classic hAtom were prefixed as such due to concerns about vocabulary overlap with the title (as in job title, completely separate semantic) property in hCard and the summary property in hCalendar (see: hAtom FAQ).
Following the simplicity principle, in microformats2, the aforementioned vagueness of title is dealt with by removing it. As name is now used consistently across all vocabularies as the property which “names” the microformat, it makes sense to use it to mark up the name of a post.
Likewise, adding entry- to summary doesn’t add any useful information, and in practice there have been no problems with blog post summaries overlapping with entry summaries, so it makes sense to simplify to summary. The same applies to entry-content simplified to content.
See also: 2012-08-30 IRC conversation.
Work that re-uses or builds upon h-entry:
This work is based on the existing hAtom microformat, and extensive selfdogfooding in the indie web camp community.
Minor editorial changes (e.g. fixing minor typos or punctuation) that do not change and preferably clarify the structure and existing intended meaning may be done by anyone without filing issues, requiring only a sufficient "Summary" description field entry for the edit. More than minor but still purely editorial changes may be made by an editor. Anyone may question such editorial changes by undoing corresponding edits without filing an issue. Any further reversion or iteration on such an editorial change must be done by filing an issue.
For the stable features of this document, substantive issue filing, resolution, and edits may be done by filing an issue and discussing them on the issue and on #microformats IRC with a link to the issue.
Because this is primarily a vocabulary specification, very few issues beyond the list of vocabulary have been filed or required any lengthy discussion. If such a non-trivial issue arises in the future, use the microformats2-parsing change control process to resolve them.
In general, non-vocabulary related features or requirements should be avoided in this specification, e.g. changes to microformats2 syntax must be proposed as microformats2-parsing changes using the microformats2-parsing change control process.
Beyond that, the following requirements must be met for adding or moving features (e.g. properties and values) to proposed, draft, or stable. File an issue to collect necessary citations for the requirements for each property being proposed or upgraded, explain how citations fulfill the requirements for the phase(s), get consensus on both (resolve any implementer objections) in the issue.
Proposed
Proposed features must provide documentation of what specific real world use-cases they are solving, preferably with a link to a step-by-step user scenario, e.g. demonstratable using existing non-standard / single-site / single-implementation tools.
Draft
Draft properties must in addition be published and consumed in the wild on the public web, demonstrate solving the use case for which they were proposed, and should provide citations of real world public web sites publishing and (other sites) consuming them, interoperably.
Stable
Stable features (e.g. Core Properties) must in addition be published and consumed in the wild on multiple sites by multiple implementations (3+ different sites and implementations for publishing and consuming). When a draft property reaches a critical mass of deployment by numerous sites and implementations (far beyond 3+), due to network effects and backward compatibility considerations it effectively becomes stable, since it becomes increasingly difficult to change it in any way and have so many sites and implementations also change.
For creating an entirely new vocabulary, and more details about how to research existing values, properties, document examples in the wild, etc., see the microformats process.