How to block ads on a specific page in WordPress?

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 specific categories.

The following tutorial explains different methods to do that.

Use Display Conditions to block individual ads

Contents

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.

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.”

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

On specific page types, e.g., Home Page

Instead of a particular static page, you can also disable ads on pages 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.

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. 

See Also  Gaslands

This is useful if you have a multi-topic website and want to make sure that your ads fit 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 categoryDisplay Condition “Categories”: Filter ads by specific post category

Block all ads on 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. You can find it on the bottom of the edit page of every post and page. 

You will see a checkbox there that allows you to disable all ads on this page.

If you are using Advanced Ads Pro, you will find a second option to disable all ads inside the post content but not from the header, the footer, or 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 AdsDisable 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.

See Also  Learn how to play a Jenga® GIANT™ game with dice

Joachim

Joachim started marketing his first local news website in 2009. Shortly after, he successfully monetized his travel blogs about Morocco. He is an expert in affiliate marketing in the tourism and travel industry. When he’s not writing tutorials for Advanced Ads or supporting other users, he prefers staying in Marrakech or at the Baltic Sea.

Rate this post
Back to top button