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:

TagSource
og:titlePost/page meta_title, or entity title
og:descriptionPost/page meta_description, or excerpt
og:imageFeatured image, or auto-generated OG image
og:urlCanonical URL of the current page
og:typearticle for posts; website for all other pages
og:site_nameSite 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:cardsummary_large_image
  • twitter:title — mirrors og:title
  • twitter:description — mirrors og:description
  • twitter:image — mirrors og: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.