Press enter to see results or esc to cancel.

Limit Insertion with Black and White Lists

Black lists and white lists are two ways to limit 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. Click on the Lists button to show available lists.

ad inserter buttons

Lists are used to limit insertion on pages or posts that have something in common (category, tag, taxonomy, url pattern) or to limit insertion based on visitor’s data (cookie, referer, IP address, country).

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, cookies, referrers 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…).

If you are using lists you don’t need to define individual exceptions for post or static pages – leave default selection 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

List tags (tag slugs) where you want insertion (white list) or don’t want insertion (black list). 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, Users and Post Types

List taxonomies (taxonomy slugs) where you want insertion (white list) or don’t want insertion (black 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.

User taxonomies work only when caching is not used.

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

List posts/page IDs where you want insertion (white list) or don’t want insertion (black list). Use this list only if you need to specify post 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

List urls where you want insertion (white list) or don’t want insertion (black 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. Separate urls with commas. 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 post IDs or individual exceptions instead. Click on the small button left of the list to open url editor.

Url Parameters and Cookies

List url query parameters or cookies where you want insertion (white list) or don’t want insertion (black list). You can specify either parameters (or cookie names) only 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.

How to show ads based on visitors’ consent?

Ad Inserter supports inserting (showing) ads based on cookies or cookie values. You can define cookie conditions by black/white-listing Url parameters (where also cookies are checked).

If you are using caching (very likely) you also need to set Dynamic blocks to Client-side insert (tab / tab General) in order to check cookies in visitor’s browser and not when the page is generated.

For example, If you are using one of the following plugins for cookie consent you need to white-list the following cookie and value in Url parameter list:

GDPR Cookie Consent White-list viewed_cookie_policy=yes
Cookie Notice for GDPR White-list cookie_notice_accepted=true
Cookie Consent White-list catAccCookies=1

 

Referers

List referers (domains) where you want insertion (white list) or don’t want insertion (black list). Use # for no referer (direct visit). Click on the small button left of the list to open referer editor.

If you are using caching (very likely) you also need to set Dynamic blocks to Client-side insert (tab / tab General) in order to check referers in visitor’s browser and not when the page is generated.

PRO IP Addresses

List IP addresses where you want insertion (white list) or don’t want insertion (black 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.

If you are using caching (very likely) you also need to set Dynamic blocks to Client-side insert (tab / tab General) in order to check IP addresses in visitor’s browser and not when the page is generated.

PRO Countries

List countries where you want insertion (white list) or don’t want insertion (black 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 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 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 use GeoLite2 data created by MaxMind). Ad Inserter Pro supports also CloudFlare geolocation.

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.

If you are using caching (very likely) you also need to set Dynamic blocks to Client-side insert (tab / tab General) in order to check countries in visitor’s browser and not when the page is generated.

Use Debugging tools widget to show and debug referers, IP addresses or countries.