6

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]

1
  • Hi @talles, if my answer has solved your question please consider accepting it. Jul 7, 2014 at 2:38

1 Answer 1

5

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.