Advertisements are a classic method of monetizing your website, and ad-serving networks such as Google Adsense make it fast and easy to start displaying ads.

It’s important for a membership site to consider which ads to display for non-members, per-level or completely hidden to members for an “ad-free” experience. Read on to explore how to control ads for your PMPro-powered membership site.

Ad Targeting For Non-Members and Per Membership Level

Considering Ads for a Membership Site

Your site’s membership is often the most lucrative product sold through your website. That said, ads can still be a component of your revenue stream if you make smart choices about ad placement for free members and site visitors.

With the methods outlined below, you can target which ads display to which users. This unlocks a unique opportunity to target your ads for each membership level, not only to hide ads for members, but to show premium ads with exclusive partner offers to your paid members.

Ad Networks, Affiliate Ads, and Direct Ad Sales

The simplest way to insert ads is via an ad network. These services connect advertisers with sites that want to make money by displaying ads. You’ll be provided with a script or other integration method to dynamically embed third-party ads on your site. Some popular ad networks that you may be familiar with include Google Adsense, Facebook Audience Network, and Amazon a9.

Alternatives to an ad network include affiliate networks or direct ad sales. For this case, you would be obtain ads (graphics, links and promos) directly through company’s affiliate program or via a service such as ShareASale or CJ Affiliate. These methods take a bit more time to set up and manage, but generally offer a higher commission than an ad network.

So how do I target ads on my membership site?

Option 1: The pmpro_displayAds() Function

This PHP function checks against the “Hide Ads from Non-Members” settings under Memberships > Advanced Settings. It allows you to wrap and insert ad blocks that will load based on how you have configured the admin setting.

if ( pmpro_displayAds() ) {
	//insert ad code here
}

Option 2: The Membership Shortcode or Block

If you are inserting ad blocks into posts or pages, you can simply use the membership shortcode or block to wrap your inserted content. Using this method, the ads will only be shown to the specified visitors or members.

Option 3: The pmpro_hasMembershipLevel() Function

This PHP function allows you to check whether a user has any membership level or a specific membership level. You can then insert your ad blocks wrapped in the appropriate conditional check to achieve the desired result.

View pmpro_hasMembershipLevel() function documentation »

Option 4: Using Advanced Ads Pro

Advanced Ads Pro has just released a native integration for Paid Membership Pro. You can now target ads on your membership site in relation to the membership level of your visitors.

Visitor Conditions using Advanced Ad Pro
View Premium Plugin

Option 5: Integrating with Other Ads Plugins for WordPress

Many ads plugins for WordPress make use of shortcodes to allow you to insert the “ad block” into your content, then manage the content of the ad in a central place. In most cases you can use these shortcodes in combination with the shortcode method outlined above.

Alternately, I have seen ads plugins that offer ads widgets. You can use these plugins in combination with the hide widgets for members recipe outlined in this post.

Lastly, if your ads plugin automatically inserts ads on pages or posts, please contact our support team (premium membership required) and we can help you locate available filters in your plugin to conditionally display ads based on membership status.

Option 6: Ad Inserter – 3rd Party Plugin

When using the third-party Ad Inserter plugin, you can use the following code recipe to hide ads from Paid Memberships Pro Members.

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.

Cover image from ebook 29 Nuggets of Wisdom Volume 1 - Sample Collection

Download the free ebook: Get 29 insights and ‘aha moments’ for new or veteran membership site business owners. Use these nuggets of wisdom to inspire or challenge you.

Was this article helpful?
YesNo