Black and White Lists

Black lists and white lists are two ways of filtering insertion. White list means that insertion will be enabled only for the items on the white list, while black list means that insertion will be disabled for all the items on the black list.

Lists are used to limit insertion on pages/posts that have something in common (category, tag, taxonomy, url pattern) or to limit insertion based on visitor's data (referer, IP address, country). Click on the Lists button to show available lists.

ad inserter lists

  • Leave list empty and set it to Black List to disable the list (default setting).
  • If you white-list items on the list, at least one of the items on the list must be present to enable insertion (item1 OR item2 OR item3…).
  • If you black-list items on the list, at least one of the items on the list must be present to disable insertion (item1 OR item2 OR item3…) i.e. no item on the list should be present to enable insertion.
  • List item separator is comma.
  • For categories and tags use slugs (name used in the url - web address).
  • Click on the small button next to list to open list editor. For categories, tags, taxonomies, post IDs and countries you can select items from the list of the available items. For urls, url parameters, referers and IP addresses you can enter one item per line in the editor.
  • If there is more than one non-empty list defined for the same code block please note the following: all lists must pass the check for insertion (list1 AND list2 AND list3…).

PLEASE NOTE: if you are using lists you don't need to define individual exceptions for post or static pages - leave default value blank unless you are using individual post/page exceptions:

ad inserter single page exceptions

Categories

List categories (category slugs) where you want insertion (white list) or don't want insertion (black list). The list can be used for posts and category pages. Click on the small button left of the list to open category selection.

Tags

Do not insert in posts with certain tags (black list) or insert only in posts with certain tags (white list). Use comma separated tag slugs. The list can be used for posts and tag / archive pages.Click on the small button left of the list to open tag selection.

ad inserter lists tags

Taxonomies (also Users and Post Types)

Do not insert in posts with certain custom taxonomies or taxonomy terms (black list) or insert only in posts with certain taxonomies (white list). You can use the following comma separated taxonomy slugs: taxonomy, term or taxonomy:term. Click on the small button left of the list to open taxonomy selection.

This list works in addition to Categories and Tags lists as categories and tags are default taxonomies. Therefore, it is possible to have categories and tags in one list, for example category:category_slug, post_tag:tag_slug. This way you can list categories and tags at the same time. Of course, if you black-list some category with Categories list or tag with Tags list then even if Taxonomies list is empty those categories or tags would be black-listed.

Users and User Roles

You can also use Taxonomies list to filter users with user:username or user roles with user-role:role. This can be used to not insert ads for certain users or user roles (black list) or to insert ads only for certain users or user roles (white list). For example, to filter all users with Administrator role use user-role:administrator, to filter user with username editor2 use user:editor2.

Post Types

In Taxonomies list you can also define post types: post-type:POST_TYPE. For example to black-list portfolio post types you should black-list post-type:portfolio.

Post IDs

Do not insert in posts/pages with certain post IDs (black list) or insert only in posts with certain IDs (white list). Use this list only if you need to specify IDs or there are only few posts to include/exclude, otherwise use individual exceptions when there are more posts to filter. Click on the small button left of the list to open post/page ID selection.

Urls

Do not insert ads on pages with certain urls (black list) or insert ads only on pages with certain urls (white list). Url used here is everything starting form the / after the domain name. For example: if web address is http://domain.com/lorem-ipsum, url to white/black-list is /lorem-ipsum You can also use partial urls with *. To filter all urls starting with /url-start use /url-start*, to filter all urls that contain url-pattern use *url-pattern*, to filter all urls ending with url-end use *url-end. WARNING: Separate urls with SPACES. Use this list only if you need to include/exclude few urls or when urls are not posts or pages, otherwise if you need to filter posts or pages use individual exceptions instead. Click on the small button left of the list to open url editor.

Url Parameters and Cookies

Do not insert ads on pages with certain url query parameters or cookies (black list) or insert ads only on pages with certain url parameters or cookies (white list). You can specify either parameters or parameters with values. For example for url http://example.com?data=2&customer-id=22&device=0 you can define url parameters data, customer-id=22 to insert ad only for urls where there is data parameter and customer-id parameter with value 22. The same applies also to cookies (use cookie_name or cookie_name=value). Click on the small button left of the list to open url parameter editor.

Referers

Do not insert ads to users from certain referers (domains) e.g technorati.com, facebook.com,... (black list) or insert ads only for certain referrers (white list): use # for no referer (direct visit). This will work only if no caching is used (and plugin is called for every pageview). Click on the small button left of the list to open referer editor.

IP Addresses (Pro only)

This list checks url parameters (PHP variable $_GET) and cookies (PHP variable $_COOKIE). Do not insert ads for certain IP addresses (black list) or insert ads only for certain IP addresses (white list). List should contain comma separated IPv4 or IPv6 addresses. You can also use partial IP addresses (or ranges) with *. To filter all IP addresses starting with ip-address-start use ip-address-start*, to filter all IP addresses that contain ip-pattern use *ip-pattern*, to filter all IP addresses ending with ip-end use *ip-end. Click on the small button left of the list to open IP address editor.

Countries (Pro only)

Do not insert ads for certain countries (black list) or insert ads only for certain countries (white list). Country list should contain comma separated country ISO Alpha-2 codes. You can also use 6 country groups which you can define on the Ad Inserter general plugin settings page (tab * / tab Geolocation). Click on the small button left of the list to open country selection.

ad inserter pro lists

Country is determined from the IP address of the website visitor. IP address database is updated automatically each month. If you have Business or Corporate Pro license you can choose between Webnet77 (default) and MaxMind geolocation database (Ad Inserter Pro will download and useGeoLite2 data created by MaxMind). Ad Inserter Pro supports also CloudFlare geolocation.

PLEASE NOTE: country code EU means non-specific European Union location - use individual country codes to target EU countries (use GB for United Kingdom) and AP means non-specific Asia-Pacific location - use individual country codes to target this region.

WARNING: If you are using caching, IP address detection and GEO targeting by default may not work as expected. It works only when the page is generated and Ad Inserter is called or when client-side IP address and country detection is enabled. Check Caching - IP address and country detection (Pro only) for details.

Use debugger widget to show and debug referers, IP addersses or countries.