Use a Resized Image for Yoast SEO’s og:image tag

A came across an issue with my site, the images used in Yoast SEO‘s og:image tag was too large for my twitter card. This was because I upload full sizes photos as my featured photos in WordPress.

Fixing this was just as simple as adding this snippet to your theme’s functions.php

function sc_opengraph_image_size() {
return "large";

This basically tells Yoast SEO to only use large images in the open graph tags generated.

And remember to always test your social images in Twitter’s Card Validator and Facebook’s URL Debugger.

ut eleifend venenatis, efficitur. ante. sed ipsum mattis Donec fringilla at