Ad-Free Members

Ad-free for members, ads for everyone else

How ad suppression works with Raptive and Mediavine, exactly who it applies to, and what it does to your ad revenue.

Overview

An ad-free experience is usually the easiest membership benefit to sell, and the one readers understand instantly. It is also the one that touches your ad network, so it is worth knowing exactly what Allspice does to your pages.

Short version: when a signed-in member has the ad-free benefit, Allspice sets the switches that Raptive and Mediavine already provide, on the server, before the page renders. It does not block, hide, or intercept ad requests itself.

How It Works

Your membership session is verified in PHP, so Allspice knows whether the reader is an ad-free member before the page is built. That timing matters: the ad state is set in the initial HTML rather than by JavaScript after ads have already started loading.

Two things are emitted, both server-side:

NetworkWhat Allspice sets
Raptive / AdThriveThe adthrive-disable-all body class - Raptive's own supported site-level switch.
MediavineA #mediavine-settings element carrying per-slot blocklist attributes.

These are the mechanisms the networks publish and consume themselves. Allspice is not doing anything unusual or adversarial to your ad stack; it is using the same switch you would use manually.

Allspice also adds two classes of its own, allspice-paid-member and allspice-ad-free-member, which you can use as styling hooks in your theme.

Both are always emitted

There is no provider detection. Both the Raptive body class and the Mediavine settings element are output together on every ad-free member page view. This is intentional: the body class is inert on a Mediavine site, and the settings element is inert on a Raptive site, so emitting both is harmless and removes an entire category of misdetection bug.

Who Gets an Ad-Free Page

Ad suppression requires a validated member session carrying the ad-free benefit specifically. Every one of the following sees your normal, fully monetised page:

  • Anonymous readers
  • Signed-in readers who are not members
  • Members whose membership does not include the ad-free benefit - for example a members-only-content tier
  • Anyone with an expired or invalid session cookie

In those cases nothing at all is emitted: no body class, no settings element. This matters for your revenue modelling. Only readers who have actually paid for an ad-free experience get one, and only while their membership is valid.

TIP:

Ad-free is a per-benefit setting, not an automatic consequence of membership. If you want a tier that unlocks content but keeps ads, simply leave ad-free off that membership.

What This Means for Your Ad Revenue

You are choosing to trade ad impressions for subscription revenue on a specific group of readers, and it is worth sizing that deliberately rather than discovering it later.

  • Your most loyal readers are usually both your most valuable ad audience and the most likely to buy a membership. Ad-free memberships convert exactly those people.
  • A member has to be worth more than the ad revenue they used to generate. Your ad network's reporting will tell you your revenue per thousand sessions; compare that against your membership price.
  • Members are typically heavy repeat visitors, so their session count per month is above average.

None of this argues against ad-free memberships. It argues for pricing them with the number in front of you.

Your Ad Network Agreement

Nothing here is a workaround. adthrive-disable-all is Raptive's own documented site-level switch, and the Mediavine settings element is Mediavine's own mechanism. Both networks built these controls specifically so publishers can run a subscription tier alongside their ads. Allspice does not block their scripts, alter their requests, or interfere with their reporting - it sets the switch they published, server-side.

Worth a courtesy note to your ad partner if your ad-free tier gets large, simply because your traffic mix is changing and they may have guidance on which slots to suppress. That is a conversation, not a permission.

Advanced Controls

Two filters are available for site owners who need them. Neither is required for normal use.

Per-network kill switch

If you need to stop Allspice touching one network - during a migration, or while debugging with your ad partner - disable it without turning off the membership benefit:

add_filter('allspice_ad_free_networks', function ($n) {
  $n['mediavine'] = false;  // leave Raptive handling on
  return $n;
});

Both default to enabled. This is an emergency switch, not a configuration step.

Video player slots

Mediavine universal-player attributes are held behind a separate filter, allspice_mediavine_blocklist_universal_player, while the intended video behaviour is confirmed. Turn it on only if you have verified with Mediavine that you want member video ads suppressed too.

Troubleshooting

A member still sees ads

  • Confirm the membership actually includes the ad-free benefit
  • Confirm they are signed in on the domain in question
  • Check the page source for allspice-ad-free-member in the body classes. If it is absent, the session was not recognised. If it is present, the switch was set and the behaviour is on your ad network's side.
  • Page caching is the most common cause by far: a cached anonymous page served to a member carries no ad-free markup. See Memberships & Page Caching for the setup.

Non-members are seeing an ad-free site

This should be impossible, since nothing is emitted without a validated ad-free session. Check that nothing else on the site - a theme option, another plugin, an ad-blocker in your own browser - is suppressing ads, then contact support.

My ad network is asking what is going on

Point them at this page. Allspice sets adthrive-disable-all for Raptive and per-slot blocklist attributes for Mediavine, server-side, only for validated ad-free members.