Using Memberpress to Convert Free Users to Paid
Posted on January 10, 2017
MemberPress is a great WordPress membership plugin that lets you create rules to protect your content and sell subscriptions to access that content. Making customized exceptions to those rules though has long been a bit challenging even for WordPress developers.
Thanks to filters added in the latest version of MemberPress however it’s now much easier to customize MemberPress rules! We did that for a client recently.
Having a Successful Membership Site
A client came to us with an existing site that had a lot of content generated over time and building a sizable list of registered users. They wanted to augment their free subscription model with selling memberships to access some of that same content.
MemberPress was built for this kind of scenario! They installed the plugin and had already set up the following tags and MemberPress rules:
- Made a whole library of premium posts
- Tagged posts appropriately: Beginner, Intermediate, and Advanced
- Created 3 paid membership levels in MemberPress (Beginner for $5/mo, Intermediate for $7/mo, and Advanced for $10/mo)
- Set up 3 MemberPress rules to:
- Protect all content tagged Beginner and allow Advanced, Intermediate, and Beginner memberships to access it
- Protect all content tagged Intermediate and allow Advanced, and Intermediate memberships to access it
- Protect all content tagged Advanced and allow Advanced memberships to access it
With the exception of creating the content, it’s a very straightforward setup, each membership level can access all the content for their subscription level and below.
Converting Existing Users to Paid Users
It’s easy to direct traffic to your sales page and to get first-time site visitors to signup for something free, but what about getting all the existing free registered users to sign up for a paid membership?
It’s also becoming common practice to build semi-permeable content gateways where a visitor can access a little content for free with or without registering but then getting locked out from viewing more content until they subscribe.
There’s no way in MemberPress at the moment to allow limited access to some things if they don’t have a MemberPress membership of some sort though. MemberPress recently added a new hook in their WordPress plugin, however that helps with this exact scenario.
What this hook allows is for a site owner to do is send an email to all their currently registered users and say “Hey, we have all this new premium content, you should buy it but as a long time registered user we’re going to give you unrestricted access to a premium lesson so you can try it out”.
By setting this up in code and allowing an existing user to get access it works out better because there’s no friction to the customer. You lose a certain percentage of people for every click you make them do to get a thing so by handling it this way it just appears to work magically as far as the customer is concerned. Another way to solve this would be to make a new membership and only allow existing members to sign up for it.
We discussed this with the client but they wanted to offer their existing base access to any single lesson they wanted. By creating a membership and then putting in a rule it would either overly give these users access to the entire library or you would have to pick a single lesson to showcase as the “free” premium one.
Custom Code for MemberPress
All of the non-code ideas were a compromise and so we went with the original plan and put in the following snippet for them.
add_filter('mepr-pre-run-rule-content', 'allow_premium_access_9s' ,10,3);
function allow_premium_access_9s( $protect, $current_post, $uri ) {
$user = new MeprUser(get_current_user_ID());
$prd = get_page_by_title('Premium Membership', OBJECT, MeprProduct::$cpt);
//make sure we have a user and the premium membership lookup succeeded
if($prd->ID && $user->ID) {
//if the user isn't already a premium member
if(!$user->is_already_subscribed_to($prd->ID)) {
$promo_access = get_user_meta($user->ID,'promo_access',true);
if(!$promo_access) {
//if the user does not already have promo access to a lesson
//allow them in to this one
update_user_meta($user->ID,'promo_access',array('lesson'=>$current_post->ID,'expiration'=>strtotime("+1 month")));
$protect = false;
} elseif($promo_access['lesson'] == $current_post->ID && $promo_access['expiration'] > time()) {
//The user has previously chosen this to be their promo lesson and
//their special access is not expired
$protect = false;
}
}
}
return $protect;
}
The thing about this rule is that it allows for some sneaky special things anytime you are running a promotion. Another good example is allowing access to a protected post if there’s a special code on the URL. Put that URL code right into your Facebook ad’s target URL and have someone get to see premium content for 1 click. Then when they go off the page you let the unauthorized message do its job and upsell them to membership status.
With the new MemberPress customizations, you can now selectively grant access to protected parts of your site without making complicated interlocking sets of rules for promotional items which sometimes live and die within days.