Structured markup data for website name
According to Google , you have to add the markup data to include your site name in search results:
In their Microdata example, they append 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, the page titles don't match the website name!
What am I missing here?
source to share
Microdata can be used on any HTML5 element (while some elements have special rules ), so you don't need to use the element title
.
If you want to keep the markup in head
, or if you don't have the site name as visible content on the master page, you can use the element meta
:
<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 can use it:
<header itemscope itemtype="http://schema.org/WebSite">
<h1 itemprop="name"><a itemprop="url" href="https://example.com/">Foobar</a></h1>
</header>
source to share