CodeBlanks Logo Icon CodeBlanks

Itemprop

HTML course · Advanced · Lesson 32/56

Use headline, datePublished and author itemprops.

What is itemprop?

After giving an element a type, you break its content into pieces with itemprop. Each itemprop carries a property name.

Three common properties on an article:

  • headline — article title (added to h1)
  • datePublished — publish date (added to time)
  • author — author (added to a span)

Example: <h1 itemprop="headline">...</h1>. Search engines then know the heading is the article's title.

Put the itemprop on the right element

The location of itemprop matters as much as its name. headline belongs on the heading, datePublished on the time element.

A misplaced itemprop misleads search engines. Use <span itemprop="author">Alex Carter</span> so the author name lives inside the element that carries the author property.

The content must be non-empty: an empty itemprop is useless.

Exercise Add itemprop to h1, time and an author span

Take the article from the previous step. Add itemprop="headline" to <h1> and itemprop="datePublished" to <time>.

Also add a new <span itemprop="author">Alex Carter</span> element to mark the author's name.

Show example solution
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Education in the AI Era</title>
  </head>
  <body>
    <article itemscope itemtype="https://schema.org/Article" itemid="/articles/education-in-the-ai-era">
      <h1 itemprop="headline">Education in the AI Era</h1>
      <p>Published: <time itemprop="datePublished">2026-03-15</time></p>
      <p>Author: <span itemprop="author">Alex Carter</span></p>
      <p>AI is reshaping the relationship between teacher and student in classrooms.</p>
    </article>
  </body>
</html>

Test yourself

  1. Which itemprop is used for the article title?

    <h1 itemprop="...">Title</h1>
    • headline
    • title
    • name
    • heading
    Show answer

    headline — Correct. The Article type names the title property headline.

  2. Add the headline itemprop to the h1 tag

    <h1 ____>Education in the AI Era</h1>
    Show answer
    <h1 itemprop="headline">Education in the AI Era</h1>
  3. Match each itemprop with its content

    headline
    Article title
    datePublished
    Publish date
    author
    Author
    name
    Person/org name

All lessons in Advanced