Thoughts on Featured Images in WordPress

When you edit a page (or blog post), you can specify a “featured image” for that page. When the page is referenced elsewhere – in a social media share, or in a list of blog posts – this image is supposed to be displayed along with the title and a text excerpt.

If you don’t specify a featured image, generally either the first image uploaded specifically for that page is used for that purpose, or no image, depending on the theme.

But what happens with the featured image when you click the link and go to the page? Is it displayed there, and if so where, and how large? Again it depends on the theme, because of developers’ differing philosophies on how featured images should be used. Many display it large at the beginning of the post. Some don’t display it at all. Some use it as a banner image. And some offer a choice between two or more of these options.

In my view, featured images shouldn’t be displayed on the page. You don’t always want them to be the first image, and you don’t always want them the same size on each page, so you should be able to select a featured image, and also insert the same image at the point in the page where you want it, without having it appear twice. You only have to upload an image once to have it available for multiple uses, so it doesn’t “cost” extra to do this.

If you agree with me on this, a theme like Twenty Nineteen, which uses the featured image as the banner and has no option to turn that off, is never a good choice. With themes that display the featured image above the page contents, though, you can use custom CSS to hide it (provided the theme lets you define CSS rules, which most do). The following rule works with various themes I’ve tried:

body.page .post-thumbnail, body.single-post .post-thumbnail, body.page .featured-image, body.single-post .featured-image  {
    display: none;
}

By specifying “body.page” and “body.single-post”, the rule applies to only a page or post, not when viewing a list of pages or posts, so you’re not also hiding the featured image on the Posts page of your site or in search results, for instance.

Featured images and social media

When a post is shared on social media, the featured image may also be picked up by the social media platform. If you haven’t specified a featured image, the social media platform may choose a different image to represent your post.

Which image is chosen depends on your theme providing correct metadata. However, the ideal image ratio for the image displayed on social media platforms may differ from what you’d prefer to use for post lists and the like on your site. If you’re willing to do the extra work, plugins like Yoast SEO let you specify a different image to use for that particular post.

SEO plugins also let you specify a default sharing image for posts which, like this one, don’t contain any graphics. If you don’t specify a default image, the share is likely to grab any random graphic on your page (maybe the page header), which is unlikely to look right in that different context. I recommend designing a default social media image for your site, using the recommended dimensions for Facebook (which work pretty well on other platforms also).

Share...

Leave a Reply

Your email address will not be published. Required fields are marked *