Paid Memberships Pro is built to restrict content on your site so only members can access protected content. You can customize the restriction settings for non-members in several ways.

This recipe removes the restricted content message from the blog homepage. It is particularly useful for sites that show blog posts in a grid layout with a short excerpt of each post. It cleans up the interface so your homepage stays welcoming and uncluttered for every visitor, member or not.

Blog homepage grid with the restricted access message removed from protected posts

Do You Need This Recipe?

This recipe is for sites that display post excerpts or teasers in a grid or list on the blog homepage, the kind of layout where a restricted-content message under every protected post clutters the page. If your homepage already hides restricted posts from the listing, or does not show excerpts at all, you likely do not need this.

Keep in mind this recipe only hides the message. It does not change what a visitor can access. Members-only content stays fully protected on the single post page; this snippet only controls whether the explanatory message appears in the homepage grid.

Best Practices and Considerations

The snippet checks both is_front_page() and is_home() because WordPress’s Settings > Reading page controls what counts as your “homepage.” is_front_page() is true on your homepage whether it is set to “Your latest posts” or a static page. is_home() is true specifically on the page showing your blog posts, which may or may not be the same page. Checking both means the snippet works no matter how your Reading settings are configured.

Because the filter runs before PMPro outputs the message, it hides the message for both logged-out visitors and logged-in non-members. Test both cases on your homepage to confirm the result looks right for each.

About the Code Recipe

This snippet targets and removes the message that normally alerts non-members about content restrictions and directs them to join or log in.

If a visitor is on the homepage, the code recipe clears the content of the no access message. On any other page, the default message keeps working as set up in your Paid Memberships Pro settings, so content restrictions are still communicated where they matter.

The is_front_page() and is_home() functions determine whether the current page is the site homepage. Depending on your WordPress settings and theme, these functions can return different results, so test the snippet on your own site to confirm it behaves as expected.

By adding this snippet, you keep the homepage clean while leaving restriction notices in place everywhere else. Potential members still learn about exclusive content without a restriction message greeting them the moment they land on your site.

Screenshots: Before and After

Blog homepage grid showing the default restricted access message on a protected post
Before: the restricted access message shows in the post grid.
Blog homepage grid with the restricted access message removed from protected posts
After: the snippet clears the message so the grid stays clean.

The Code Recipe

Adding the Recipe to Your Website

You can add this recipe to your site by creating a custom plugin or using the Code Snippets plugin available for free in the WordPress repository. Read this companion article for step-by-step directions on either method.

How to Customize This Code Recipe

  • Cover tag or category archives (line 18): If your theme also displays posts in a grid on tag or category archives, extend the is_front_page() || is_home() check on this line to include is_tag() or is_category().



Was this article helpful?
YesNo

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