29

For better SEO I need put some meta on my page like this:

<!-- Schema.org markup for Google+ -->
<meta itemprop="name" content="The Name or Title Here">
<meta itemprop="description" content="This is the page description">
<meta itemprop="image" content="http://www.example.com/image.jpg"> 

Here is the source.

Then I check this code on Markup Validation Service:

<!DOCTYPE html>
<html>
<head lang="en">
  <meta itemprop="name" content="The Name or Title Here">
  <meta itemprop="description" content="This is the page description">
  <meta itemprop="image" content="http://www.example.com/image.jpg">
  <meta charset="UTF-8">
  <title>My title</title>
</head>
<body>
  My body.
</body>
</html>

Throwing this error:

Line 4, Column 57: The itemprop attribute was specified, but the element is not a property of any item.

 <meta itemprop="name" content="The Name or Title Here">

Line 5, Column 70: The itemprop attribute was specified, but the element is not a property of any item.

 <meta itemprop="description" content="This is the page description">

Line 6, Column 68: The itemprop attribute was specified, but the element is not a property of any item.

 <meta itemprop="image" content="http://www.example.com/image.jpg">

How can I fix this?

unor
  • 92,415
  • 26
  • 211
  • 360
rpayanm
  • 6,303
  • 7
  • 26
  • 39
  • Note that you [must use the `link` element (instead of `meta`) if the value is a URL](http://stackoverflow.com/a/24659620/1591669). So your third `meta` element should be this instead: `` – unor Mar 18 '15 at 14:39

2 Answers2

41

You should explicitly provide a type these properties (name, description, image) belong to.

In Schema.org, everything is a Thing. Thing has many child types, listed under "More specific Types". Start there and choose the most specific type for your content.

For example: WebPage, Article or maybe BlogPosting.

It could look like (using WebPage as example here):

<html itemscope itemtype="http://schema.org/WebPage">
unor
  • 92,415
  • 26
  • 211
  • 360
  • Thanks for the answer. and please share how to add country code and postal address using schema in web page – Jomal Johny Jan 02 '19 at 04:08
  • 1
    @JomalJohny: This wouldn’t be the right place here. If you have a problem implementing it, please ask a question and describe the problem in detail. – unor Jan 02 '19 at 09:00
3

If you use itemprop meta tag in header for your site title, description and so on.

only just add itemscope itemtype="http://schema.org/WebPage" in your html tag.

Usage:

<html itemscope itemtype="http://schema.org/WebPage">
Mahdi Bashirpour
  • 17,147
  • 12
  • 117
  • 144