Tilbage til Schema
🌐
WebSite Schema
Fundamentet for dit websites structured data - definerer grundlæggende site information
Hvad er WebSite Schema?
WebSite schema er fundamentet for dit websites structured data. Det definerer grundlæggende information om hele dit website og bruges ofte sammen med SearchAction for sitelinks searchbox. Det bør implementeres på din homepage.
Anvendelsesområder:
- • Definerer site navn og URL
- • Foundation for SearchAction (sitelinks searchbox)
- • Kapcsol med Organization schema
- • Støtter alternative sprog versioner
- • Basis for site-wide structured data
Required Properties
name
Website navn
url
Homepage URL
Basic Example
Minimal WebSite Schema
{
"@context": "https://schema.org",
"@type": "WebSite",
"name": "Example Company",
"url": "https://www.example.com"
}With SearchAction
Kombiner med SearchAction for sitelinks searchbox:
{
"@context": "https://schema.org",
"@type": "WebSite",
"@id": "https://www.example.com/#website",
"name": "Example Company",
"url": "https://www.example.com",
"description": "Danmarks bedste SEO værktøj",
"inLanguage": "da-DK",
"publisher": {
"@type": "Organization",
"name": "Example Company",
"@id": "https://www.example.com/#organization"
},
"potentialAction": {
"@type": "SearchAction",
"target": {
"@type": "EntryPoint",
"urlTemplate": "https://www.example.com/search?q={search_term_string}"
},
"query-input": "required name=search_term_string"
}
}Multilingual Websites
For websites med flere sprog versioner:
{
"@context": "https://schema.org",
"@type": "WebSite",
"name": "Example Company",
"url": "https://www.example.com",
"inLanguage": ["da-DK", "en-US"],
"workTranslation": [
{
"@type": "WebSite",
"url": "https://www.example.com/en",
"inLanguage": "en-US"
},
{
"@type": "WebSite",
"url": "https://www.example.de",
"inLanguage": "de-DE"
}
]
}Combined with Organization
Link WebSite schema til Organization schema:
{
"@context": "https://schema.org",
"@graph": [
{
"@type": "Organization",
"@id": "https://www.example.com/#organization",
"name": "Example Company",
"url": "https://www.example.com",
"logo": "https://www.example.com/logo.png"
},
{
"@type": "WebSite",
"@id": "https://www.example.com/#website",
"name": "Example Company",
"url": "https://www.example.com",
"publisher": {
"@id": "https://www.example.com/#organization"
}
}
]
}Next.js Implementation
// app/layout.tsx
export default function RootLayout({ children }) {
const websiteSchema = {
"@context": "https://schema.org",
"@type": "WebSite",
"@id": "https://www.example.com/#website",
"name": "Example Company",
"url": "https://www.example.com",
"description": "Danmarks bedste SEO værktøj",
"inLanguage": "da-DK",
"potentialAction": {
"@type": "SearchAction",
"target": {
"@type": "EntryPoint",
"urlTemplate": "https://www.example.com/search?q={search_term_string}"
},
"query-input": "required name=search_term_string"
}
};
return (
<html lang="da">
<head>
<script
type="application/ld+json"
dangerouslySetInnerHTML={{
__html: JSON.stringify(websiteSchema)
}}
/>
</head>
<body>{children}</body>
</html>
);
}Best Practices
✓ Gør dette
- • Implementer på homepage
- • Brug unique @id for referencing
- • Kombiner med Organization schema
- • Tilføj SearchAction hvis relevant
- • Specificer inLanguage
- • Link til publisher
✗ Undgå dette
- • Multiple WebSite schemas på samme domain
- • Implementering på subpages
- • Manglende name eller url
- • Forkert URL format
- • Inconsistent naming
- • Duplicate schema markup