3

According to Google, you should add a markup data in order to include your site name in the search results:

Search results website name

In their example of Microdata usage, they attach the website name to the page title:

   <head itemscope itemtype="http://schema.org/WebSite">
   <title itemprop='name'>Your WebSite Name</title>
   <link rel="canonical" href="https://example.com/" itemprop="url">

But obviously page titles are not the same as website name!
What am I missing here?

unor
  • 92,415
  • 26
  • 211
  • 360
Ronen Teva
  • 1,345
  • 1
  • 23
  • 43

1 Answers1

4

Microdata can be used on any HTML5 element (while some elements come with special rules), so you don’t have to use the title element.

If you want to keep the markup in the head, or if you don’t have the site name as visible content on your homepage, you could use the meta element:

<head itemscope itemtype="http://schema.org/WebSite">
  <title>Welcome to Foobar!</title>
  <meta itemprop="name" content="Foobar" />
  <link itemprop="url" href="https://example.com/" />
</head>

But if you have the site name as visible content, for example in the page header, you could make use of it:

<header itemscope itemtype="http://schema.org/WebSite">
  <h1 itemprop="name"><a itemprop="url" href="https://example.com/">Foobar</a></h1>
</header>
Community
  • 1
  • 1
unor
  • 92,415
  • 26
  • 211
  • 360
  • Thanks. Why did Google use the title tag in their example? I can't see any case where this will make sense – Ronen Teva Jul 24 '15 at 12:44
  • @RonenTeva: Many websites use only the site name in the homepage’s `title`, e.g., http://stackoverflow.com/ (title: "Stack Overflow") or https://www.google.com/ (title: "Google"). A common structure is `[site-name]` for the homepage, and `[page-name] [delimiter] [site-name]` for every other page. – unor Jul 24 '15 at 12:47
  • Ohhh am I expected to only set it in the homepage and not on every page? – Ronen Teva Jul 24 '15 at 13:04
  • 1
    @RonenTeva: You may use `WebSite` on every page (after all, the site name is not the only thing this type is useful for, and Google is not the only consumer of it), but Google will only look on the site’s homepage for the [Site Name](https://developers.google.com/structured-data/site-name) markup: "Publish markup on your official website homepage" – unor Jul 24 '15 at 13:07
  • So that's what I was missing :) Thanks. – Ronen Teva Jul 24 '15 at 13:55