Make sure an image shows when you link your site to facebook

I came across this as, when i updated my website, i noticed that an image was no longer showing.

After looking through a few posts and using the facebook debugger –

https://developers.facebook.com/tools/debug/

I realised my og:image was blank.

Yoast seo solution

 

If you use Yoast you can set the facebook image for each page.

 

Scroll down to Yoast seo section and set teh facebook image there:

Jetpack solution

 

https://jetpack.com/2013/07/12/add-a-default-image-open-graph-tag-on-home-page/

I used the code snippet plugin:

https://wordpress.org/plugins/code-snippets/

Which i love as it means you don’t have to mess around with functions.php and can easily activate and deactivate the code you add.

The code snippet that worked for me was:

function custom_jetpack_default_image() {
return 'YOUR IMAGE URL';
}
add_filter( 'jetpack_open_graph_image_default', 'custom_jetpack_default_image' );

Ensuring that the image was at least 200px x 200px