For what I Google-searched, looks like that the <time>
element was dropped and bring back to HTML5 specs later (right?) *
I want to clarify:
*Right now*, what is the correct way to mark the publication date on an article on a HTML page?
Is pubdate
still supported?
I'm using the following way:
<time datetime='2014-07-02' pubdate>July 2014</time>
Is it correct?
* [1][2][3][4][5][6]
I would embed schema.org Article structured data on the page and use the datePublished
property.
From their homepage:
This site provides a collection of schemas that webmasters can use to markup HTML pages in ways recognized by major search providers... Search engines including Bing, Google, Yahoo! and Yandex rely on this markup to improve the display of search results, making it easier for people to find the right Web pages.
Here's an example, adapted from the Article example to include datePublished
per the spec for dates, which you'll note uses the time
element:
<div itemscope itemtype="http://schema.org/Article">
<span itemprop="name">How to Tie a Reef Knot</span>
by <span itemprop="author">John Doe</span>
published <time itemprop="datePublished" datetime="2014-07-02">July 2nd, 2014</time>
</div>
To answer whether pubdate
is still supported, you can refer to the latest HTML5 spec directly, and see that aside from global attributes, the only other attribute specified is the datetime
attribute for indicating a machine-readable version of the content. If you scroll further, one of the examples for this element in the spec uses the schema.org vocabulary for an article's publication date.
Using a microdata format like schema.org will ultimately give you more control over how search engines and other crawlers interpret the data on your page.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With