How to allow a user to bypass the meter based on referrer URL, such as Google or MailChimp first click free

Let's say you'd like to exclude click-throughs from your MailChimp newsletters from the meter. Or allow anyone who comes from Facebook to be able to view your content without triggering the meter. Using the leaky_paywall_filter_is_restricted filter you can check for any of those conditions before the meter and subscribe nag are triggered on an article. 

The first article viewed doesn’t count toward the meter, and then the meter starts on the next article read.

Hard restricted content can also be opened to search engine bots such as Googlebot, using the Search Engine Bot Bypass setting. 

Bypass paywall based on referrer URL

In the gist below, the $bypass_value is set to the value you want to look for in either the referring site or the url. 

Tip for Mailchimp: email apps often don't pass on the referring site, so matching the referrer may not catch clicks from your Mailchimp newsletter. Instead, turn on Google Analytics link tracking in your Mailchimp campaign. Mailchimp then adds tracking tags such as utm_medium=email to your links, and you can set $bypass_value to one of those tags so it matches the URL.

Bypass paywall based on User Agent

For search engines you don't need code any more. In Leaky Paywall 5.0 and later, turn on Search Engine Bot Bypass under Leaky Paywall > Settings > Restrictions. It lets Googlebot, Bingbot and other search engine bots read the full article, and you can turn on Paywall Schema Markup there too. Use the code below only for other user agents. You can bypass the paywall for a specific user agent, such as Googlebot.  Please be aware that user agents can be faked by a browser.

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us