Docs
Add OGzap to your site
Pick your platform below, paste the snippet, and every page you share will show a beautiful branded OG image — automatically.
WordPressGhostRaw HTMLAny site
WordPress
Add to your theme's functions.php
PHP · functions.php
// Add to functions.php
add_action('wp_head', function() {
$u = urlencode(get_permalink());
echo '<meta property="og:image" content="https://ogzap.com/og?url=' . $u . '&customer=YOURKEY" />';
});Ghost
Settings → Code Injection → Site Header
HTML · Code Injection
<!-- Paste into Code Injection -> Site Header
so social scrapers see the meta tag without running JS. -->
<script>
(function() {
var canonical = document.querySelector('link[rel=canonical]');
var u = encodeURIComponent(canonical ? canonical.href : window.location.href);
var meta = document.createElement('meta');
meta.setAttribute('property', 'og:image');
meta.setAttribute('content', 'https://ogzap.com/og?url=' + u + '&customer=YOURKEY');
document.head.appendChild(meta);
})();
</script>Raw HTML meta tag
Any site — paste in your <head>
HTML · meta tag
<!-- Replace the url= value with the full URL of THIS page (one per page). -->
<meta property="og:image" content="https://ogzap.com/og?url=https://yoursite.com/this-page&customer=YOURKEY" />💡
Replace YOURKEY
Replace YOURKEY with your actual customer key — find it in your OGzap dashboard. Questions? hello@ogzap.com
Need help? hello@ogzap.com
← OGzap home