Schema.org/Microdata markup for list of recent posts without providing author / publisher?
It’s perfectly fine not to provide these properties. Schema.org doesn’t require any property.
If Google’s Structured Data Testing Tool says that certain properties are missing, what it really means is:
"If you don’t provide these properties, we won’t show the corresponding Rich Snippet or Knowledge Graph feature in Google Search"
There’s no need to get rid of your structured data just because Google (as one of many consumers) currently doesn’t do something with it. It can be useful for other consumers, and Google may change/introduce features in the future that work with your current set of properties.
Google requiring certain properties for certain types when adding Schema.org markup?
These are required/recommended for getting one of Google’s search features.
If you don’t want that Google search feature, or if you can’t provide all necessary properties, you can keep everything like it is and ignore the errors and warnings.
Related answers
- Should Schema.org dateModified have some default value if not available?
- Schema.org/Microdata markup for list of recent posts without providing “author” / “publisher”?
- Do I have to create new visible elements to abide by Google's Microdata Schema.org requirements?
- Omitting price property for sold products?
- Use Schema.org for Article without image property?
- Image missing and required - Wordpress AMP Structure doesn't add Image attribute
On Webmasters SE:
- Schema.org BlogPosting and image required
- Is it mandatory to have rich snippets for AMP pages?
Schema.org NewsArticle: invalid value for logo property
Your markup is valid HTML5+Microdata and you are using the Schema.org vocabulary appropriately.
With "validator", you probably refer to Google’s Structured Data Testing Tool. Note that errors shown in this tool don’t necessarily mean that your markup is wrong; they often mean that you won’t get a certain Google search result feature unless you provide certain properties.
If you want to get this search result feature in Google Search (e.g., the Article Rich Snippet), you have to provide an ImageObject
item as value (instead of a URL value) for the logo
property.
<div itemscope itemprop="publisher" itemtype="http://schema.org/Organization">
<div itemprop="logo" itemscope itemtype="http://schema.org/ImageObject">
<img itemprop="url" src="https://www.mysite.de/resources/assets/71/small/my_logo_web.png" />
<!-- and Google probably requires some more properties here, e.g. "height" and "width" -->
</div>
<span itemprop="name">My Company</span>
</div>
What to do if publisher and author property have the same value?
In JSON-LD (in contrast to Microdata and RDFa), you have no choice other than to duplicate it.
However, you don’t necessarily have to provide the full Organization
item in both places. Give your Organization
a URI with @id
, and then reference this URI in the other place:
"author": {
"@type": "Organization",
"@id": "/#org",
"url": "/",
"name": "Nosek Inc.",
"description": "Great organization"
},
"publisher": {"@id": "/#org"}
It often make sense to provide/duplicate at least some properties, though, e.g., important ones like @type
, name
, url
etc.:
"publisher": {
"@type": "Organization",
"@id": "/#org",
"name": "Nosek Inc."
}
Invalid Schema.org location property in Event
Your markup is correct according to Schema.org: the location
property may contain Text.
When Google’s SDTT reports an error, it doesn’t necessarily mean that your markup is wrong. Often it just means that you won’t get one of Google’s search result features for your page.
In your case, the error is related to Google’s Event Rich Snippet. For showing this snippet, Google requires that the location
property has a Place
or a PostalAddress
item as value, but not Text (although Google also says "A text string is permitted […]", but their testing tool doesn’t seem to like it).
Your second snippet does that, but it doesn’t nest the div
with the location
property in the div
for the SportsEvent
, so the location is not associated with the event.
About your third snippet: It seems to be a bug in the testing tool that it requires an address
property for PostalAddress
(Schema.org doesn’t define one). If you care about the "errors" the testing tool reports, it should work if you use Place
as value for location
, with an address
that has a PostalAddress
item as value. It also works if you provide Place
and use Text in the address
property:
<div itemprop="location" itemscope itemtype="http://schema.org/Place">
<span itemprop="name">Test</span>
<span itemprop="address">29-31 Craven Rd, London W2 3BX</span>
</div>
Schema markup relating to data outside of div
As explained in my answer, the element you want to add has to have the itemprop
attribute. So this is the structure you need:
<div itemprop="publisher" itemscope itemtype="http://schema.org/Organization" id="organization">
</div>
<article itemscope itemtype="http://schema.org/Article" itemref="organization">
</article>
(This should only be used on pages where the Organization
is added as publisher
; otherwise it’s invalid HTML+Microdata if the itemprop="publisher"
doesn’t belong to an itemscope
.)
If you now replace the <asp:…>
elements with actual HTML elements, Google’s SDTT is able to understand what you want to convey: it adds the name
/url
/logo
properties to the Organization
item, and it adds this Organization
item as publisher
to the Article
item.
<div itemprop="publisher" itemscope itemtype="http://schema.org/Organization" id="organization">
<a itemprop="url" href="/example">
<img itemprop="logo" src="example.png" alt="Sample Image" />
</a>
<meta itemprop="name" content="My Co" />
</div>
<article itemscope itemtype="http://schema.org/Article" itemref="organization">
</article>
The errors Google’s SDTT still reports are not actual errors with your Schema.org/Microdata. These are just properties that Google requires for getting their search result features. In the case of logo
, Google wants to see an ImageObject
value.
Related Topics
How to Set The Background Color of <Option> in a <Select> Element
Angular4 - Scrolling to Anchor
Wrapping Flex Items in The Last Row
How to Prevent Text from Overflowing in CSS
String Attribute Values in Multiple Lines, HTML
Curved Lines Using Only HTML And/Or CSS
Box-Sizing: Border-Box => for Ie8
Two Input Fields Inside One Label
What Does It Mean When The Form Action Attribute Is "#" (Number/Pound Symbol/Sign/Character)
CSS Grid Layout in Chrome Seems Not to Work Properly with More Than 1000 Rows
HTML.Beginform() with an Absolute Url
CSS Calc Viewport Units Workaround
Where Is The Default Size of a Div Element Defined or Calculated
@Media Queries and Image Swapping
How to Resolve 500 Internal Server Error
Angular Checkboxes "Select All" Functionality with Only One Box Selected Initially