Change thumbnail size for sharing on social media in All in One SEO Pack

By default, when All in One SEO Pack shares your post thumbnail (now called featured image) with social media networks such as Facebook or Twitter via Opengraph, it uses the large version. You can change the size using our aioseop_thumbnail_size filter hook.


add_filter( 'aioseop_thumbnail_size', 'change_aioseop_thumbnail_size' , 10, 1);

function change_aioseop_thumbnail_size( $size ){
return 'medium';
}

The built-in sizes are thumbnail, medium, and large. If you have a custom thumbnail/featured image size, you can use that too.

add_image_size( 'custom_image_size_1', 390, 200, true );

add_filter( 'aioseop_thumbnail_size', 'change_aioseop_thumbnail_size', 10, 1);

function change_aioseop_thumbnail_size( $size ){
return 'custom_image_size_1';
}

Skip to toolbar