> ## Documentation Index
> Fetch the complete documentation index at: https://memberful.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Offer members an ad-free experience

> Reward paying members on your WordPress site with an ad-free experience. Hide ads for logged-in members so they can focus on your content without interruption.

export const ContactSupport = ({label = "Contact us to get set up →", fallbackEmail = "info@memberful.com", className = ""}) => {
  const handleClick = e => {
    e.preventDefault();
    if (typeof window !== 'undefined' && window.Intercom) {
      try {
        window.Intercom('showNewMessage');
        return;
      } catch (error) {
        console.warn('Intercom failed to open:', error);
      }
    }
    window.location.href = `mailto:${fallbackEmail}`;
  };
  return <a href={`mailto:${fallbackEmail}`} onClick={handleClick} className={className}>
      {label}
    </a>;
};

export const RelatedDocs = ({link1, link2, link3, link4, link5, link6, link7, link8, link9, link10, className = ""}) => {
  const links = [link1, link2, link3, link4, link5, link6, link7, link8, link9, link10].filter(Boolean);
  if (!links.length) return null;
  return <section className={`related-docs border dark:border-gray-700 rounded-2xl px-6 py-4 mt-6 ${className}`}>
      <p className="mb-2 font-medium">
        <strong>Related help docs:</strong>
      </p>
      <ul className="space-y-1 mb-1 mt-1">
        {links.map((link, index) => <li key={index}>
            <a href={link.url}>{link.label}</a>
          </li>)}
      </ul>
    </section>;
};

Memberful supports select ad platforms and includes built-in tools that let you control when ads are suppressed based on a member's login status or subscription.

In this help article, we'll show you how to configure ad platform settings, use Memberful's WordPress functions and member roles, and control when ads are suppressed.

## Hide ads using our plugin

Ad platform settings are available in the Memberful settings in WordPress.

To access them:

1. Go to ***WordPress → Settings → Memberful***.
2. Open the **Hide ads** tab.

<Frame>
  <img src="https://mintcdn.com/memberful/of06StbPsXQS27k8/images/wordpress-plugin/protect-content/offer-members-an-ad-free-experience/hide-ads-tab.png?fit=max&auto=format&n=of06StbPsXQS27k8&q=85&s=04c30f01f14ba76625574e7340007b6b" alt="Hide ads in WordPress settings" width="1440" height="625" data-path="images/wordpress-plugin/protect-content/offer-members-an-ad-free-experience/hide-ads-tab.png" />
</Frame>

## Enable an ad platform

Each supported ad platform (Raptive, MediaVine, and Advanced Ads) appears in the list when our WordPress plugin is installed.

If a platform plugin is not installed, it will appear as *(not installed)*.

Once the ad platform plugin is installed, click the platform checkbox to enable it. Enabling a platform makes its suppression settings available.

Ads are not disabled until you select at least one suppression option.

<Frame>
  <img src="https://mintcdn.com/memberful/of06StbPsXQS27k8/images/wordpress-plugin/protect-content/offer-members-an-ad-free-experience/hide-ads-provider.png?fit=max&auto=format&n=of06StbPsXQS27k8&q=85&s=618333e612cdc8ae96b32011addb6143" alt="Select ads provider in plugin" width="1440" height="879" data-path="images/wordpress-plugin/protect-content/offer-members-an-ad-free-experience/hide-ads-provider.png" />
</Frame>

## Choose when ads are disabled

After enabling a platform, choose when ads should be disabled. You can select one or more of the following options.

### Disable ads for members with an active subscription to a specific plan

Disable ads only for members who have an active subscription to one or more selected plans.

To configure this option, select one or more plans from the list.

<Frame>
  <img src="https://mintcdn.com/memberful/of06StbPsXQS27k8/images/wordpress-plugin/protect-content/offer-members-an-ad-free-experience/hide-ads-specific-plans.png?fit=max&auto=format&n=of06StbPsXQS27k8&q=85&s=65f6182253a86d861a7d55d9a6dbd33d" alt="Hide ads for specific plans" width="1440" height="879" data-path="images/wordpress-plugin/protect-content/offer-members-an-ad-free-experience/hide-ads-specific-plans.png" />
</Frame>

Ads are disabled for members actively subscribed to the selected plan(s).

### Disable ads for any member with an active subscription

Disable ads for all members who have at least one active subscription, regardless of plan.

<Frame>
  <img src="https://mintcdn.com/memberful/of06StbPsXQS27k8/images/wordpress-plugin/protect-content/offer-members-an-ad-free-experience/hide-ads-for-active-subscriptions.png?fit=max&auto=format&n=of06StbPsXQS27k8&q=85&s=e7d572807f47815dd343690c69827fb5" alt="Hide ads for active subscription" width="1440" height="691" data-path="images/wordpress-plugin/protect-content/offer-members-an-ad-free-experience/hide-ads-for-active-subscriptions.png" />
</Frame>

### Disable ads for all logged-in users

Disable ads for all logged-in users, regardless of subscription status (active, inactive, or free), role, or plan.

<Frame>
  <img src="https://mintcdn.com/memberful/of06StbPsXQS27k8/images/wordpress-plugin/protect-content/offer-members-an-ad-free-experience/hide-ads-for-all-members.png?fit=max&auto=format&n=of06StbPsXQS27k8&q=85&s=90eef8baffdb28858bb93f97d79668f8" alt="Memberful hide ads for all members" width="1440" height="640" data-path="images/wordpress-plugin/protect-content/offer-members-an-ad-free-experience/hide-ads-for-all-members.png" />
</Frame>

### How precedence works

When multiple suppression options are selected, broader rules override more specific ones.

Precedence order:

1. Disable ads for all logged-in users
2. Disable ads for any member with an active subscription
3. Disable ads for members with an active subscription to a specific plan

<Callout icon="triangle-alert" color="#FFE044">
  If you enable "Disable ads for all logged-in users" or "Disable ads for any member with an active subscription," those settings override any plan-specific selections.
</Callout>

If no suppression rules apply to a visitor, ads continue to display normally.

### Save your changes

After configuring your ad settings, click **Save Changes** to apply them.

Changes take effect immediately for visitors who meet the selected conditions.

<Frame>
  <img src="https://mintcdn.com/memberful/5cwNFV44acxY5wI8/images/wordpress-plugin/protect-content/offer-members-an-ad-free-experience/hide-ads-and-save-changes.png?fit=max&auto=format&n=5cwNFV44acxY5wI8&q=85&s=cd802b4aa73d8d9a90d108f3c0c72154" alt="Hide ads and save changes" width="1440" height="640" data-path="images/wordpress-plugin/protect-content/offer-members-an-ad-free-experience/hide-ads-and-save-changes.png" />
</Frame>

## Hide ads using WP functions

Another way to hide ads for paying members is to leverage [Memberful's WordPress functions](/wordpress-plugin/protect-content/wordpress-functions/) to add an HTML/CSS class to the page, which would determine whether the ads should be displayed or not.

First, we'll use our WP function `is_subscribed_to_any_memberful_plan()` to determine whether or not a member is a paying member.

If they are, use the `body_class` filter to add a custom class to the page's `<body>` tag. The following snippet can be added to your theme's functions, either by inserting it into the functions.php file or by using a code snippets plugin with the capability to add new WordPress functions.

```php theme={null}
function add_memberful_body_class( $classes ) {
    if ( is_subscribed_to_any_memberful_plan( wp_get_current_user()->ID ) ) {
        $classes[] = 'active-memberful-member';
    }
    return $classes;
}
add_filter( 'body_class', 'add_memberful_body_class' );
```

In the above example, the `active-memberful-member` class is added to the page's `<body>` tag whenever the current member is subscribed to any plan.

You can then use CSS to hide any ads if that class is present.

```css theme={null}
body.active-memberful-member .ad {
    display: none;
}
```

Alternatively, you could use JavaScript to hide ads when the class is present:

```javascript theme={null}
document.addEventListener('DOMContentLoaded', function() {
    if (document.body.classList.contains('active-memberful-member')) {
        const ads = document.querySelectorAll('.ad');
        ads.forEach(function(ad) {
            ad.style.display = 'none';
        });
    }
});
```

The examples above hide any elements that have the `ad` class, but you can adjust the selector to match your specific ad implementation.

## Hide ads using member roles

If your ad platform supports hiding ads for paying members based on their user roles in WordPress, you could use this functionality in conjunction with [Memberful's Advanced Role Mapping.](/wordpress-plugin/setup/install-the-memberful-plugin/#configure-role-mapping)

<RelatedDocs
  link1={{
url: "/wordpress-plugin/protect-content/restrict-access-to-a-single-post/",
label: "Restrict access to individual posts.",
}}
  link2={{
url: "/wordpress-plugin/protect-content/bulk-restrict-access/",
label: "Restrict access to multiple posts in bulk.",
}}
  link3={{
url: "/website-builder/video-content/restrict-access-to-video-content/",
label: "Restrict access to video content.",
}}
/>
