With Advanced Ads, you can exclude ads from specific posts and pages. E.g., you can keep your ads away from appearing on your home page, contact or privacy policy pages. Or you want to exclude ads from posts of certain categories. The following tutorial explains different methods to do that.

Use Display Conditions to block individual ads

Display Conditions define features of posts or pages on which an ad is displayed or hidden. You can fine-tune under which conditions ads should or should not be shown.

a) On specific pages

With the “Specific Pages” Display Condition on the ad edit page, you can enter the title or the ID of the site where this particular ad should or in our case shouldn’t appear. That’s all, and you can check the results of your settings on your pages afterward.

In the following example, you can see a setting for an ad that appears on all pages except “Cart” and “Checkout.”

Option to disable ads in Cart and Checkout

We recommend this method if you want to exclude single ads from specific pages, e.g., if you use ads for internal services and you want to disable them on your landing pages.

b) On specific page types, e.g., home page

Instead of a particular static page, you can also disable ads on pages that are created dynamically by WordPress, like the home page.

Just choose the “General Conditions” option in the Display Conditions section.

The example below has the ad disabled on the home page, archive pages, search result pages, the 404 page, and all attachment pages.

Option to disable ads on page types like home page or archive pages.

c) On specific categories or tags

If you want to show ads only on posts from a specific category or with certain tags, you can assign the Display Conditions “Categories” or “Tags” to your ad unit. This is useful, if you have a multi-topic website and want to make sure that your ads fit to the content.

The following example shows a Display Condition of an ad unit, that will only be displayed on posts from the categories “News” and “Travel”.

Display Condition "Categories": Filter ads by specific post category
Display Condition “Categories”: Filter ads by specific post category

Disable all ads in specific pages

If you want to disable all ads on specific posts or pages, it is easier not to exclude them one by one with individual display conditions. In this case, you should look out for the Ad Settings meta box which you can find on the bottom of the edit page of every post and page. You will see a checkbox there which allows you to disable all ads on this page.

If you are using Advanced Ads Pro, you will find a second option there to disable all ads inside the post content but not from the header, the footer or your sidebar.

Option to disable ads on pages

We recommend this method if you want to keep specific pages with fewer clicks or legal pages completely ad-free.

Generally disable ads on a specific post type

If you want to generally disable ads on a specific post type please go to the general settings of Advanced Ads. At Advanced Ads > Settings > General > Disable ads you can opt-in on which post types ads should not appear.

Disable ads for post types in the settings of Advanced Ads
Disable ads for post types in the settings of Advanced Ads

Constant to hide ads

You can also hide all coming ads by setting the ADVADS_ADS_DISABLED  constant in your theme or plugin like in the code below.

if(!defined('ADVADS_ADS_DISABLED')){
    define('ADVADS_ADS_DISABLED', true);
};

Once you set the constant, future loaded ads won’t be displayed.