Display Conditions define features of pages on which an ad is displayed or hidden.

Please note that Display Conditions are not injecting ads (this is what Placements are for). They only limit already injected ads to specific pages.


In this video (4:08 min) I am explaining how to use the display conditions. The manual below might cover these topics in more details, but I think it is a good starting point.

Start Video
(click to start)


You can set Display Conditions in the Display Conditions meta box on the ad edit screen.

If you want to display the ad everywhere, you don’t need to set any display conditions.

You can add more conditions by adding them through the New condition option. (see the list of Display Conditions below).

You can remove conditions by clicking on the (x) button behind the line. The less conditions you use, the better for your site’s performance.

Some conditions allow you to select whether you want to show or hide ads only on pages with the selected feature.

Blue elements are activated, while grey elements are disabled.

Choices within a condition set are combined via OR. E.g., when you select multiple categories for a post with an ad, the post only needs to belong to one of these categories for the ad to show up.

The ad with the following Display Conditions would only show up on posts that are in one of the selected categories: Featured, Best articles, or News.

Advanced Ads selected categories

Combining multiple conditions

Advanced Ads AND OR switch

By default, different conditions are combined via AND. This means that in every row, there must be a true feature for the current page before an ad is displayed. E.g., when you have a setting to show the ad on a specific category and post tag page, the post must belong to the category AND the tag in order to show the ad.

Take a look at the Display Conditions examples gallery, too.

The following example combines two Categories conditions. It displays the ad in posts with the Best Articles category, but prevents it from showing up in posts that are also in the News category.

Advanced Ads categories conditionsYou can also change the connector from AND to OR by just clicking on it. An OR connector in front of a condition simply means that the previous condition can be false, but the whole conditions return true, if the OR combined check is true.

In the example below, the conditions are connected using OR, because it is impossible for a single page to be the “Display Conditions Manual” page and the “Best Articles” category page at the same time. So, using AND here would result in the ad never to show up.

Ads in specific pages or in specific category

List of available Display Conditions

Please note, that the available Conditions are dynamic. For each public taxonomy (Categories and Tags by default), new conditions are added.

Accelerated Mobile Pages (AMP)The AMP condition allows you to display ads on Accelerated Mobile Pages. See Display Ads on AMP pages.
Archive: {taxonomy}While {taxonomy} is a placeholder for any taxonomy (Categories and Tags by default), this option can be used to limit ads to specific archive pages. Archive pages are lists of posts or other post types belonging to a specific taxonomy.

Every taxonomy has its own display condition set. The defaults are Categories and Tags.

With more than 50 terms per taxonomy, there is a search field instead of a list with all terms.

AuthorThe Authors Conditions allows you to limit ads to posts from specific authors.
Content AgeThe Age condition allows you to display ads based on the age of the content, e.g. “older than 5 days”
FeedThe Feed condition allows you to display ads in the Feed of your site. See Ads in Feeds.
Format, Archive: Format
Post Formats are a feature in some themes allowing you to customize the output of a post.
General Conditions
The General Conditions are a set of most important page types and active by default.

Find remarks on Secondary Queries below.

Display ads only on specific pages in a paginated post.

Advanced Ads Pro

Paid Memberships Pro
Display or hide ads based on the defined membership level of content pages.

ManualAdvanced Ads Pro

Parent Page
Display an ad based on the parent page for hierarchical post types (including pages).

Advanced Ads Pro

Post Meta
The post meta condition allows you to target a meta value attached to a post or page.

Advanced Ads Pro

Post Type
Choose the public post type of content where the ad can be displayed. This condition is working on single pages as well as archive pages.
Post Type / Page TemplateDisplay ads based on the post type template (since WordPress 4.7).

Advanced Ads Pro

Specific Pages
Display or hide an ad from specific published posts or pages. Just start typing the title of the page to see suggestions or search for the post/page ID.
TaxonomyWhile the Archive: {taxonomy} condition can be used for individual terms from a given taxonomy, the Taxonomy condition is meant to limit ads to archive pages for all terms belonging to a taxonomy.
{taxonomy}, Categories, Tags
While {taxonomy} is a placeholder for any taxonomy (Categories and Tags by default), this option can be used to limit ads to posts which belong to these specific terms.

Every taxonomy has its own display condition set. The defaults are Categories and Tags.

URL ParametersDisplay ads based on url parameters. This is useful if you have specific parameters in your url or you want to create additional display conditions.

ManualAdvanced Ads Pro

WPML languageDisplay ads based on the page language set by the WPML plugin.

Advanced Ads Pro

Secondary Queries

Secondary Queries in WordPress could be list of posts that don’t belong to the post type, but are added in addition. E.g. on a single post the main post would be the primary query, but a list of related posts in the sidebar or post teasers below the main article could be a secondary query.

With ad injections it can happen that teasers from secondary queried posts also contain ads. To prevent this from happening you can disable ads on Secondary Queries on a per-ad basis or globally in the plugin settings.

Debugging Display Conditions

There are various reasons why Display Conditions could not work, here are some:

  • a custom query was not used properly
  • the conditions are wrongly connected (e.g., AND used instead of OR)
  • the content is requested via ajax
  • the content is requested in an iframe

Neither of the problems above are caused by Advanced Ads, but there is a way Advanced Ads can help you to solve them. Switch the ad to debug mode for more information.

See Using the ad debug mode.

Changes with version 1.7

If you used Display Conditions in Advanced Ads before version 1.7, you might take a look at the biggest changes we made with that version:

  • Every taxonomy (tags, categories, etc.) now has its own condition set.
  • For taxonomies you now either choose the terms for which the ad is displayed or the ones for which it isn’t, but not both.
  • When you update to version 1.7, your previous display conditions will be logged to debug.log, if enabled. See this tutorial about how to find PHP errors with WP_DEBUG and WP_DEBUG_LOG for more information. You can use this information in case something was mixed up.
  • If you limited ads with the individual posts option, this will now be honored also when the ad is injected into the post content and it is displayed on archive pages.
  • The home page setting from the General Conditions now also works for single page homepages.
  • You can choose whether your conditions are connected via an AND or OR operator.

What else you need to know

Practically, you don’t need to set display conditions in case you use the ad in a place where it should always appear. The more specific the place, e.g. using the the_ad() function within a specific template file like single.php the less carefull you probably need to define the display conditions.

 Display Conditions, Publishing Ads