Choosing a Schema.org Identity
Set up your site identity with defineOrganization(), definePerson(), or defineLocalBusiness(). Unhead can then reference that node as the publisher, author, brand, provider, or subject of related nodes.
Why identity matters
An identity gives search engines a consistent entity for the site and its related content. Organization markup can help Google understand administrative details and disambiguate an organization, but it does not guarantee a particular search feature.
Choose an identity type
Choose the type that matches what the site represents. Use Organization for a site that does not represent a person or a physical business.
Organization
Use Organization for companies, brands, and other non-person entities.
- It does not need to represent an incorporated business.
- It suits an ecommerce brand without a physical customer location.
Examples include project and company sites such as nuxt.com and vuejs.org.
import { defineOrganization, defineWebPage, defineWebSite, useSchemaOrg } from '@unhead/schema-org'
useSchemaOrg(unheadInstance, [
defineOrganization({
name: 'My company',
logo: '/logo.png',
sameAs: [
'https://twitter.com/company'
]
}),
defineWebSite({/* ... */}),
defineWebPage(),
])
Person
Use Person when your website represents an individual, personal brand, or personal blog.
A personal portfolio, author site, or personal blog usually uses Person.
import { definePerson, defineWebPage, defineWebSite, useSchemaOrg } from '@unhead/schema-org'
useSchemaOrg(unheadInstance, [
definePerson({
name: 'Harlan Wilton',
image: '/me.png',
sameAs: [
'https://github.com/harlan-zw',
]
}),
defineWebSite({/* ... */}),
defineWebPage(),
])
LocalBusiness
Use LocalBusiness when your website represents a physical business with an address.
- Extends Organization.
- Suits ecommerce businesses with a physical customer location.
A cafe, clinic, or retail store website is a typical case.
import { defineLocalBusiness, defineWebPage, defineWebSite, useSchemaOrg } from '@unhead/schema-org'
useSchemaOrg(unheadInstance, [
defineLocalBusiness({
name: 'Harlan\'s Hamburgers',
address: {
streetAddress: '123 Main St',
addressLocality: 'Harlan',
addressRegion: 'MA',
postalCode: '01234',
addressCountry: 'US',
},
image: 'https://example.com/images/storefront.jpg',
}),
defineWebSite({/* ... */}),
defineWebPage(),
])
Automatic relationships
Unhead uses the primary identity for these relationships:
| Node | Property |
|---|---|
| Article | publisher, author |
| Product | brand |
| WebSite | publisher |
| WebPage | about on the homepage when both nodes are registered |
Related Recipes
- Blog Posts: Article structured data
- E-commerce: Product structured data
- Site Search: Search action markup
Custom Nodes
Create custom Schema.org types not in built-in helpers. Pass plain objects to useSchemaOrg() with TypeScript support via schema-dts.
Schema.org for a Blog
Add Article or BlogPosting structured data with defineArticle() so search engines can understand a post and its author, dates, and images.