Many themes display a post’s featured image in the archives, search results, widgets and more. For a membership site, the featured image may contain specialized information you only want to show to your members. Use this code recipe to ensure that only your active members get the full experience of your valuable content.

PMPro - Hide featured images from non-members

About the Code Recipe

This code recipe will ensure that only your active members have the ability to see a post’s featured image. When scrolling through the list of your available articles, non-members will be able to see the title and excerpt of your post but will not see the thumbnail image linked to the article. This gives members an added benefit of signing up for your membership.

Keep in mind that sometimes the right featured image can help convert a user into a member. So there are many cases where you might want to keep your thumbnail featured image visible.

Note: This recipe only hides the image if it is inserted using the WordPress post_thumbnail_html function. It will not protect the source location of the image (see docs) and may not exclude it from open graph meta in your site’s head area depending on what social sharing, SEO and other plugins are in place for your site.

Need Some Help?

We offer support for implementing this code recipe into your website. Reach out to our support engineers over on our Member Support Area.


The Code Recipe


Adding the recipe to your website

Copy and paste this code recipe into a helper PMPro Customizations plugin.

Free Course: Membership Site Development—The Basics

Develop a deeper understanding of membership site development in this beginner-level course. Learn how to make your site work better, save yourself time and money, and improve your site's performance.

Featured Image for Membership Site Development Course: The Basics
Was this article helpful?
YesNo