OG images for any PHP site
A few lines in your shared <head> template. The path is read from each request, so every page gets its own image.
Get startedAbout 3 minutes · plain PHP, Laravel, Symfony
Make your preview
Paste your site, pick a design and publish. Open Add to site → PHP for a snippet with your site ID.
Paste into your layout
Put it in the file every page includes — header.php, layout.php or your base template.
header.php · inside <head>
<?php
$path = trim((string) parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH), '/');
$image = htmlspecialchars('https://getwowimg.com/a1b2c3d4e5/' . ($path === '' ? 'index' : $path) . '.png', ENT_QUOTES, 'UTF-8');
?>
<meta property="og:image" content="<?= $image ?>" />
<meta property="og:image:width" content="1200" />
<meta property="og:image:height" content="630" />
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:image" content="<?= $image ?>" />a1b2c3d4e5 is a sample site ID — Add to site gives you the code with yours.Using Blade or Twig?
Same idea: build the path from the request and print the tags in the base layout.
resources/views/layouts/app.blade.php
@php($path = trim(request()->path(), '/') ?: 'index')
<meta property="og:image" content="https://getwowimg.com/a1b2c3d4e5/{{ $path }}.png" />
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:image" content="https://getwowimg.com/a1b2c3d4e5/{{ $path }}.png" />a1b2c3d4e5 is a sample site ID — Add to site gives you the code with yours.LinkedInLooks good
[Brand]Turn shares into clicksyourproduct.com
Launch week: everything we shippedyourproduct.com
Before and after
BEFORE · no og:image
Your brand@yourbrand · 2m
New post is liveyourproduct.comLaunch week: everything we shipped
AFTER · getwowlinkyourproduct.com
Your brand@yourbrand · 2m
New post is live[Brand]Turn shares into clicksyourproduct.com
Questions
WordPress is PHP too — should I use this?
No, use the WordPress snippet: it works through Yoast and Rank Math without editing your theme's head.
I already have og:image tags.
Remove them from the template, or social apps may pick the old picture.
Does the query string matter?
No. We ignore it — /page?utm=x and /page get the same image.
Try it on your site
Three designs made from your site — no sign-up to try.