How to change OG image
-
Hello, is it possible to change the source of OG image file?
From this:
<meta property="og:image" content="https://www.wp.com/wp-content/uploads/2024/08/image.jpg" class="yoast-seo-meta-tag" />
<meta property="og:image:width" content="1920" class="yoast-seo-meta-tag" />
<meta property="og:image:height" content="2560" class="yoast-seo-meta-tag" />To something like this:
<meta property="og:image" content="https://www.wp.com/wp-content/uploads/2024/08/image-768x1024.jpg" class="yoast-seo-meta-tag" />
<meta property="og:image:width" content="768" class="yoast-seo-meta-tag" />
<meta property="og:image:height" content="1024" class="yoast-seo-meta-tag" />I want to use smaller image, which is automatically generated by WP (medium size). From some reason the image in highest resolution is not available on my website.
I tried this from your webpage, but it is not working:
function yoast_seo_opengraph_change_image_size() {
return 'medium';
}
add_filter( 'wpseo_opengraph_image_size', 'yoast_seo_opengraph_change_image_size' );Thank you!
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘How to change OG image’ is closed to new replies.