Meta Tags & Open Graph
Unfold CMS automatically generates meta tags, Open Graph tags, and Twitter Cards for all your content. SEO data is managed through the admin panel and rendered using the ralphjsmit/laravel-seo package.
How It Works
Every page in Unfold CMS automatically includes:
- Title tag — Generated from content title + site suffix
- Meta description — From content excerpt or custom description
- Open Graph tags — For Facebook, LinkedIn, and social sharing
- Twitter Card tags — For Twitter/X previews
- Canonical URL — Prevents duplicate content issues
The CMS handles this in two layers:
- Controllers set SEO data before rendering:
seo()->for($post) - Templates output the tags in the
<head>:{!! seo() !!}
Admin Panel
Per-Post SEO
When editing a blog post or page, the SEO section allows you to customize:
| Field | Description |
|---|---|
| SEO Title | Custom title (overrides the post title) |
| Meta Description | Custom description for search results |
| Focus Keyword | Target keyword for content optimization |
| OG Image | Custom Open Graph image for social sharing |
| Robots | Per-page robot directives (index/noindex, follow/nofollow) |
If you leave these fields empty, the CMS generates sensible defaults from the content.
Global SEO Settings
Configure site-wide SEO defaults (homepage title, title suffix, fallback description, fallback image, canonical URLs) in Settings > SEO in the admin panel.
Generated Tags
For a blog post titled "Getting Started with Laravel", the CMS generates:
<!-- Basic -->
<title>Getting Started with Laravel | MySite</title>
<meta name="description" content="Learn how to build your first Laravel application...">
<link rel="canonical" href="https://example.com/blog/getting-started-with-laravel/">
<!-- Open Graph -->
<meta property="og:type" content="article">
<meta property="og:title" content="Getting Started with Laravel">
<meta property="og:description" content="Learn how to build your first Laravel application...">
<meta property="og:image" content="https://example.com/storage/posts/featured-image.jpg">
<meta property="og:url" content="https://example.com/blog/getting-started-with-laravel/">
<meta property="og:site_name" content="MySite">
<!-- Twitter Card -->
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="Getting Started with Laravel">
<meta name="twitter:description" content="Learn how to build your first Laravel application...">
<meta name="twitter:image" content="https://example.com/storage/posts/featured-image.jpg">
Pagination SEO
Blog listing pages automatically include rel="prev" and rel="next" link tags to help search engines understand paginated content:
<link rel="prev" href="https://example.com/blog?page=1">
<link rel="next" href="https://example.com/blog?page=3">
Robots Meta Tag
Control how search engines index individual pages:
| Directive | Meaning |
|---|---|
index, follow |
Index the page and follow links (default) |
noindex, follow |
Don't index, but follow links |
index, nofollow |
Index the page, but don't follow links |
noindex, nofollow |
Don't index or follow links |
Set per-page robots directives in the post/page editor's SEO section.
For Template Developers
Outputting SEO Tags
Include this in your layout's <head> section:
<head>
{!! seo() !!}
@stack('head')
</head>
The {!! seo() !!} call outputs all meta tags, Open Graph tags, and Twitter Card tags.
Setting SEO Data in Controllers
// Auto-generate from a model
seo()->for($post);
// Manual SEO data
seo()
->title('Custom Page Title')
->description('Custom description for this page');
Custom Head Tags
Templates can push additional tags to the head:
@push('head')
<link rel="prev" href="{{ $paginationMeta['prev'] }}">
<link rel="next" href="{{ $paginationMeta['next'] }}">
@endpush
Related
- Structured Data — JSON-LD schemas for rich results
- Sitemaps — XML sitemap configuration
- Permalinks — URL structure settings