Jeremy Herve<blockquote><p>Here’s my suggestion. When the user specifies a <a href="https://wordpress.com/support/featured-images/" rel="nofollow noopener" target="_blank">featured image</a> for a post, set the og:image element in the head section of the page. When they don’t specify such an image, omit that element.</p><p><a href="http://scripting.com/2025/06/02/131444.html#a132153" rel="nofollow noopener" target="_blank">http://scripting.com/2025/06/02/131444.html#a132153</a></p></blockquote><p><a rel="nofollow noopener" class="u-url mention" href="https://mastodon.social/@davew" target="_blank">@davew</a> We’ve gone back and forth on this over the years. It can be a bit tricky.</p><p>Our first implementation worked just like your suggestion, and like on your site right now. It worked reasonably well, but some social networks (namely Facebook) look for images in the page’s HTML whenever no <code>og:image</code> tag is found. And at that point, you have no control over what Facebook picks up ; it may be a image in the footer of the page, a still from an embed, or any other image it would pick up from the post, your sidebar, or your footer.</p><p>Folks were understandably not happy to see Facebook pick up random images from their site, so we decided to add that fallback ; when no image is found in the post, we try to find a representative image from the site to offer instead. We look for a site logo, a site icon, a blank image, or a custom fallback image that can be provided.</p><p><a rel="nofollow noopener" class="hashtag u-tag u-category" href="https://herve.bzh/t/en/" target="_blank">#EN</a> <a rel="nofollow noopener" class="hashtag u-tag u-category" href="https://herve.bzh/t/open-graph/" target="_blank">#OpenGraph</a> <a rel="nofollow noopener" class="hashtag u-tag u-category" href="https://herve.bzh/t/wordpress/" target="_blank">#WordPress</a></p>