OpenGraph & JSON-LD
Pubvana automatically generates OpenGraph tags for social media sharing previews and JSON-LD structured data for Google rich results — on every post and page.
TL;DR
Automatic. Pubvana generates OpenGraph tags for Facebook and LinkedIn sharing and JSON-LD for Google rich results on every post and page. Set a featured image on your posts to get the best social sharing preview. No configuration required.
Details
OpenGraph Tags
OpenGraph tags control how your content appears when shared on Facebook, LinkedIn, Slack, and any other platform that reads OG metadata. Pubvana generates the full set on every page:
| Tag | Source |
|---|---|
og:title | Post/page meta_title, or entity title |
og:description | Post/page meta_description, or excerpt |
og:image | Featured image, or auto-generated OG image |
og:url | Canonical URL of the current page |
og:type | article for posts; website for all other pages |
og:site_name | Site name from General Settings |
Twitter Card Tags
Twitter Card tags control link previews on X (Twitter). Pubvana always uses summary_large_image card type:
twitter:card—summary_large_imagetwitter:title— mirrorsog:titletwitter:description— mirrorsog:descriptiontwitter:image— mirrorsog:image
JSON-LD: Article Schema
On single post pages, Pubvana outputs an Article JSON-LD script block in <head>. This powers rich results in Google Search (author bylines, publication dates, images in search cards):
{
"@context": "https://schema.org",
"@type": "Article",
"headline": "Your Post Title",
"author": {
"@type": "Person",
"name": "Author Name",
"url": "https://yourdomain.com/author/username"
},
"datePublished": "2025-03-01T09:00:00+00:00",
"dateModified": "2025-03-05T11:30:00+00:00",
"image": "https://yourdomain.com/uploads/my-featured-image.jpg",
"description": "Post excerpt or meta description text.",
"publisher": {
"@type": "Organization",
"name": "Your Site Name",
"logo": { "@type": "ImageObject", "url": "https://yourdomain.com/logo.png" }
},
"mainEntityOfPage": "https://yourdomain.com/post/your-post-slug"
}
JSON-LD: BreadcrumbList Schema
A BreadcrumbList schema is output on all pages to power Google's breadcrumb trail display in search results:
{
"@context": "https://schema.org",
"@type": "BreadcrumbList",
"itemListElement": [
{ "@type": "ListItem", "position": 1, "name": "Home", "item": "https://yourdomain.com/" },
{ "@type": "ListItem", "position": 2, "name": "Category", "item": "https://yourdomain.com/category/tech" },
{ "@type": "ListItem", "position": 3, "name": "Post Title" }
]
}
OG Image Auto-Generation
When a post has no featured image, OgImageService automatically generates a branded social sharing image using PHP's GD library:
- Dimensions: 1200 × 630 px (standard OG image size)
- Content: Site brand colour background with the post title overlaid in white text
- Caching: Generated images are cached per post slug in
writable/og_images/ - Invalidation: The cached image is deleted and regenerated when the post title changes
For best results, always set a featured image on your posts. This gives you full control over how the post appears when shared on social media.