I changed the thumbnail image from default for the “WP-OGP” plugin that sets up Facebook OGP in WordPress.
First, I tried overwriting wp-content/plugins/wp-ogp/default.jpg to change the thumbnail image, as this was supposed to work.
I was able to clear the cache properly with Facebook Debugger Tool, but when actually sharing on Facebook, it remained the default image.
Eventually, I handled it by changing the filename as follows.
Steps to Change WP-OGP Thumbnail Image
- Place the new thumbnail image file codenote-net-200x200.jpg under wp-content/plugins/wp-ogp/
- Change the image path returned by the wpogp_image_url_default method in wp-content/plugins/wp-ogp/wp-ogp.php as follows:
function wpogp_image_url_default() { // default image associated is in the plugin directory named "default.png" //return wpogp_plugin_path() . '/default.jpg'; return wpogp_plugin_path() . '/codenote-net-200x200.jpg'; } - Delete cache with Facebook Debugger Tool
That’s all from the Gemba.
