The og:image URL returns a non-image content-type, causing social cards to display without an image preview.
By Seoxpert Editorial · Published
Social platforms rely on the og:image meta tag to display rich previews when your content is shared. If the image URL serves HTML instead of an image, no preview image appears, reducing click-through rates and engagement from social shares.
Social shares of your content will lack image previews, significantly lowering visibility and click-through rates.
A crawler requests the og:image URL and checks if the Content-Type response header is an image type (e.g., image/jpeg, image/png); if not, it flags the issue.
Problem: Next.js API route returns HTML instead of image
// pages/api/og-image.js
export default function handler(req, res) {
// Incorrect: returns HTML
res.setHeader('Content-Type', 'text/html');
res.status(200).send('<html>App Shell</html>');
}Fix: Next.js API route returns proper image content-type
// pages/api/og-image.js
export default function handler(req, res) {
// Correct: returns PNG image
const imageBuffer = generateImageSomehow();
res.setHeader('Content-Type', 'image/png');
res.status(200).send(imageBuffer);
}This usually happens when your router or SPA catch-all route serves the app shell for unknown paths, including image URLs.
Use 'curl -I <image-url>' or open the URL in your browser and inspect the response headers.
It should return an image MIME type such as image/jpeg, image/png, or image/webp.
Ensure static images are in the public/ directory or, for dynamic images, set the correct Content-Type header in your API route.
Run a scan to see if Social Card Image URL Does Not Serve an Image affects your pages.
Scan my website →