Allow Limited Number of Free pageviews before requiring membership

We would like to implement a paywall that allows 10 pageviews per month before a user is required to have a subscription. How can we implement this?

  • Adam Czajczyk
    • Support Gorilla

    Hello Cagle Webmaster

    I hope you're well today and thank you for your question!

    The Membership 2 Pro doesn't provide such feature, I'm afraid. This could be possible to achieve, however, with some additional custom code hooked to the Membership 2 Pro as the plugin provides API.

    What it could be would be that for example: you set one free membership that protects all the content that should be behind the paywall and the second one that also protects the same content but is paid.

    When a visitor comes to the site and tries to read such protected article, he/she is given a choice to either sign up for the full paid membership or to use the "free 10 pageviews". If the first option is selected, the case is clear - user signs up for a regular paid membership and gets access to the content.

    If the second option is selected - user signs up for the free membership and also gets full access to all the content but then the custom code comes in play: whenever any user opens any page that is protected with a paid membership that code should check:

    - if the viewing user is a member of a paid or free membership
    - if paid, does nothing;
    - if free it checks the number in some user-meta
    - if that number is less then e.g. 10 it simply updates it by one
    - if that number is more than 10 it means that the user reached the limit and in such case that custom script redirects user to some special page where there is an infomration that they need to pay and the membership signup shortocde is included for that paid membership.

    That should work and should be doable but I'm afraid it's quite a bit of custom coding which would be outside the scope of this support forum. If you feel like giving it a try by yourself please feel free to ask in case you needed some more information about Membership 2 Pro API.

    If you need it to be developed for yourself, you might want to consider hiring a developer. A good place to start with could be service. On our Partners page here

    you can grab a nice discount for it too.

    Best regards,

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.