Squarespace uses your featured image as the OG image. With Imago API, get branded text-based cards that actually stand out on social.
Start Generating FreeAdd via Settings > Advanced > Code Injection > Header.
Reads h1 or page title automatically for dynamic previews.
Pure client-side solution — no server changes needed.
Add this snippet to your Squarespace Code Injection:
<!-- Squarespace: Settings > Advanced > Code Injection > Header -->
<script>
document.addEventListener('DOMContentLoaded', function () {
var h1 = document.querySelector('h1.entry-title, h1.blog-title, h1');
var title = (h1 && h1.textContent.trim()) || document.title;
var ogUrl = 'https://imagoapi.com/api/og/generate?title='
+ encodeURIComponent(title)
+ '&template=modern&api_key=YOUR_IMAGO_KEY';
var existing = document.querySelector('meta[property="og:image"]');
if (existing) {
existing.setAttribute('content', ogUrl);
} else {
var meta = document.createElement('meta');
meta.setAttribute('property', 'og:image');
meta.setAttribute('content', ogUrl);
document.head.appendChild(meta);
}
});
</script>
Join thousands of Squarespace sites using Imago API for stunning OG images.
Start Free Trial