Documentation

Every ad in WP Ad Inserter is an independent campaign, which is assigned to one specific position on your site. It can be a specific place in the post or page body, an excerpt, a widget, a front page, an archives page, a shortcode or any other place defined by the user according to his own rules.

Each company is a one single spot that contains your ad, or a set of an unlimited number of ads that can be randomly rotated each time they are displayed. There is also no limit on the number of ad campaigns. You can add new campaigns, edit and delete existing ones, as well as change the sequence in which they are displayed.

Lets take a look on the all available ad campaign settings.

Campaign name

Here you can can give some informative name or a short description to every ad campaign, for your convenience. It will be useful to easy recognize your ad campaigns in the list.

Ad code

This field contains your actual ad code in HTML, JavaScript and PHP (note below) formats. You may have any number of different ad codes in the same campaign. Just separate them with <!--more--> divider. Like this, to show different ads on different pages of the site or rotate them each time the page is displayed (note below):

<a href="https://www.amazon.com/Multi-Use-Duct-2930-C-Inches-Yards/dp/B0013B1XHE" target="_blank"><img style="margin: auto; display: block; width: auto;" src="https://m.media-amazon.com/images/I/81h0sinp0UL._SX522_.jpg" /></a>
<!--more-->
<h2 style="text-align:center;"><?php echo date('l', time()); ?> is the best day to buy our <a href="https://www.amazon.com/Cedar-Broom-Step-Dustpan-PowerCorner/dp/B08Z9ZLLVX/ref=sr_1_5" target="_blank">SUPER BROOM</a>!</h2>
<!--more-->
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<ins class="adsbygoogle"
     style="display:inline-block;width:728px;height:90px"
     data-ad-client="ca-pub-2471978045069124"
     data-ad-slot="7520161498"></ins>
<script>
    (adsbygoogle = window.adsbygoogle || []).push({});
</script>

There are 3 sample ad codes, placed into the same ad campaign code box. As you can see, you can mix HTML, PHP and JavaScript in any way you like.

As you can see, it’s a simple code editor with a full-featured HTML/CSS/JS/PHP syntax highlighting. I believe it’s the exact feature that you need to insert any sort of as such as Google AdSense and Amazon Ads snippets, your own static banners, dynamic JS ads, popups etc. The WP Ad Inserter plugin has no fancy and monstrous, but slow, clumsy and useless visual Gutenberg-like block editor that no one ever uses in real life. To be honest, would you use a visual editor to copy-paste an AdSense snippet or to add a HTML code for a banner with your affiliate link? In 90% cases you will just copy-paste any ad code right from your affiliate program’s “ad tools” page.

Ad behavior

You may choose the ad behavior, depending on number of previous ad shows. The following options are available:

  • Always display
  • Skip if the max number of ads in this spot reached
  • Skip if the max number of all displayed ads on site reached

If you select the 2nd or 3rd option, you will be asked to enter the maximum number of ads in the spot or on the whole webpage.

Position

Here you should set the position of the ad on the site. WP Ad Inserter gives you the following options to choose from:

▪️ Manual

The ad will not be shown unless it is manually included as a shortcode in a post or in a text widget. It can also be included in a WordPress theme as PHP code.

▪️ Before the Loop

The ad will be shown before the WordPress Loop. The Loop is a PHP code block that displays WordPress posts. The loop is used in WordPress themes to display a list of posts in a web page. Thus the ad will be placed before all posts on the index page, archives page, tag page category page page or search results page.

▪️ After the Loop

In contrast to “Before the Loop”, the ad will be placed after all posts, shown in the Loop.

▪️ Before content

Places the ad before of the post or page content.

▪️ After content

Places the ad after of the post or page content.

▪️ Before paragraph

Sets a paragraph number before which the ad should be inserted. If the number is negative, the paragraphs will be counted from the end of the post. When the number is equal to zero (0), a random paragraph will be used.

▪️ After paragraph

Sets a paragraph number after which the ad should be inserted. If the number is negative, the paragraphs will be counted from the end of the post. When the number is equal to zero (0), a random paragraph will be used.

▪️ Before heading

Selects a heading tag and set the section number after which the ad should be inserted. If the number is negative, the headings will be counted from the end of the post. When the number is equal to zero (0), a random heading will be used.

▪️ After heading

Selects a heading tag and set the section number after which the ad should be inserted. If the number is negative, the headings will be counted from the end of the post. When the number is equal to zero (0), a random heading will be used.

▪️ Before image

Sets an image number before which the ad should be inserted. If the number is negative, the images will be counted from the end of the post. When the number is equal to zero (0), a random image will be used.

▪️ After image

Sets an image number after which the ad should be inserted. If the number is negative, the images will be counted from the end of the post. When the number is equal to zero (0),
a random image will be used.

▪️ Before post

Sets a post number before which the ad should be inserted on the site homepage, search results page, category page or archive page. Use this mode to insert ads between posts in the Loop.

▪️ Site footer

Places the ad into the site footer.

▪️ Before comment form

Places an ad above the comment form (figure 1).

▪️ After comment form

Places an ad below the comment form (figure 1).

▪️ Comment form top

Places an ad before the comment form (figure 1).

▪️ Comment form before fields

Places an ad before the data fields on the comment form (figure 1).

▪️ Comment form after fields

Places an ad after the data fields on the comment form (figure 1).

WP Ad Inserter comment form positions

Figure 1

▪️ WP Ad Inserter widget

Displays the ad in the WP Ad Inserter widget

Between HTML elements

This is probably the most powerful method that allows you to insert ads anywhere in the HTML body of your posts and pages.

Moreover, this method allows you to use regular expressions, which makes it even more flexible.

Display in

Here you can specify which WordPress page types the ad will be shown. The following options are available:

  • posts
  • pages
  • excerpts
  • hompage
  • categories
  • archives
  • search results

For example. Let’s consider you want to display your add in all single posts and pages, but don’t want to display them when your posts are shown on post list pages including your home page. In this cause you should select “posts” and “pages” only. Everything else must be deselected. And don’t forget to choose the Position in the post (e.g. “after 3rd paragraph”).

Shortcode

Here you will find a WordPress shortcode for the edited ad company. Use it to insert the ad into any pars of your post or page. You should use the “Manual” option in the Position drop-down box.

PHP code for theme

Use this PHP code to embed the WP Ad Inserter campaign shortcode into a theme.

Execute PHP

Enable this option to allow WP Ad Inserter to execute PHP code mixed with HTML and JavaScript all together. The code must be always enclosed by the standard PHP open and close tags (<?php and >).

Don’t worry to make a mistake in your PHP code. In contrast to other plugins that allow users to run PHP code in them, WP Ad Inserter will not crash your site. It will just show a error message with a problematic campaign ID.

Rotate

When enabled, the ads divided by the <!--more--> separator will be rotated every time a webpage is displayed. Otherwise, every post will be shown with the same ad. For example, one post will always display first ad code block and the another post will display the second one.

Categories

The option allows you to select a display rule and specify a comma-separated list of post category names. The ad will be displayed if the post meets one of the following rules by your choice:

  • It does belong to at least one of the specified categories.
  • It does NOT belong to any of the specified categories.
  • It does belong to all selected categories together.

The category names are case-insensitive.

Tags

The option allows you to select a display rule and specify a comma-separated list of post category tags. The ad will be displayed if the post meets one of the following rules by your choice:

  • It’s tagged with at least one of the specified tags.
  • It’s NOT tagged with any of the specified tags.
  • It’s tagged with all the selected tags together.

The tag names are case-insensitive.

Keywords

The option allows you to select a display rule and specify a comma-separated list of keywords and ke phrases. The ad will be displayed if the post content and/or title and/or excerpt meets one of the following rules by your choice:

  • It does contain at least one of the specified keywords/keyphrases.
  • It does NOT contain any of the specified keywords/keyphrases.
  • It does contain all the selected keywords/keyphrases together.

The keywords are case-insensitive and only full words are counted. This means that the “floccin” keyword will not trigger on the following sentence: “Ironically, floccinaucinihilipilification is a pretty valueless word itself”.

Devices

This option allows you to selcet the visitor device types (compuers, tablets, mobile phones) to show or hide your ads for.

ISO country codes

This is probably the most useful feature for any ad management software. Almost any product is aimed at a specific group of countries. Nobody wants to promote air conditioners in Island, right? 😉

With WP Ad Inserter you can make a comma-separated list of allowed and disallowed countries for every single campaign. The plugin detects the country by a visitor’s IP address.

Below are ISO country codes for countries for your convenience.

ISO Code Country
AD Andorra
AE United Arab Emirates
AF Afghanistan
AG Antigua and Barbuda
AI Anguilla
AL Albania
AM Armenia
AN Netherlands Antilles
AO Angola
AP Asia/Pacific Region
AQ Antarctica
AR Argentina
AS American Samoa
AT Austria
AU Australia
AW Aruba
AX Aland Islands
AZ Azerbaijan
BA Bosnia and Herzegovina
BB Barbados
BD Bangladesh
BE Belgium
BF Burkina Faso
BG Bulgaria
BH Bahrain
BI Burundi
BJ Benin
BM Bermuda
BN Brunei Darussalam
BO Bolivia
BR Brazil
BS Bahamas
BT Bhutan
BV Bouvet Island
BW Botswana
BY Belarus
BZ Belize
CA Canada
CC Cocos (Keeling) Islands
CD Congo, The Democratic Republic of the
CF Central African Republic
CG Congo
CH Switzerland
CI Cote D’Ivoire
CK Cook Islands
CL Chile
CM Cameroon
CN China
CO Colombia
CR Costa Rica
CS Serbia and Montenegro
CU Cuba
CV Cape Verde
CX Christmas Island
CY Cyprus
CZ Czech Republic
DE Germany
DJ Djibouti
DK Denmark
DM Dominica
DO Dominican Republic
DZ Algeria
EC Ecuador
EE Estonia
EG Egypt
EH Western Sahara
ER Eritrea
ES Spain
ET Ethiopia
EU Europe
FI Finland
FJ Fiji
FK Falkland Islands (Malvinas)
FM Micronesia, Federated States of
FO Faroe Islands
FR France
FX France, Metropolitan
GA Gabon
GB United Kingdom
GD Grenada
GE Georgia
GF French Guiana
GG Guernsey
GH Ghana
GI Gibraltar
GL Greenland
GM Gambia
GN Guinea
GP Guadeloupe
GQ Equatorial Guinea
GR Greece
GS South Georgia and the South Sandwich Islands
GT Guatemala
GU Guam
GW Guinea-Bissau
GY Guyana
HK Hong Kong
HM Heard Island and McDonald Islands
HN Honduras
HR Croatia
HT Haiti
HU Hungary
ID Indonesia
IE Ireland
IL Israel
IM Isle of Man
IN India
IO British Indian Ocean Territory
IQ Iraq
IR Iran, Islamic Republic of
IS Iceland
IT Italy
JE Jersey
JM Jamaica
JO Jordan
JP Japan
KE Kenya
KG Kyrgyzstan
KH Cambodia
KI Kiribati
KM Comoros
KN Saint Kitts and Nevis
KP Korea, Democratic People’s Republic of
KR Korea, Republic of
KW Kuwait
KY Cayman Islands
KZ Kazakhstan
LA Lao People’s Democratic Republic
LB Lebanon
LC Saint Lucia
LI Liechtenstein
LK Sri Lanka
LR Liberia
LS Lesotho
LT Lithuania
LU Luxembourg
LV Latvia
LY Libyan Arab Jamahiriya
MA Morocco
MC Monaco
MD Moldova, Republic of
ME Montenegro
MG Madagascar
MH Marshall Islands
MK Macedonia
ML Mali
MM Myanmar
MN Mongolia
MO Macau
MP Northern Mariana Islands
MQ Martinique
MR Mauritania
MS Montserrat
MT Malta
MU Mauritius
MV Maldives
MW Malawi
MX Mexico
MY Malaysia
MZ Mozambique
NA Namibia
NC New Caledonia
NE Niger
NF Norfolk Island
NG Nigeria
NI Nicaragua
NL Netherlands
NO Norway
NP Nepal
NR Nauru
NU Niue
NZ New Zealand
OM Oman
PA Panama
PE Peru
PF French Polynesia
PG Papua New Guinea
PH Philippines
PK Pakistan
PL Poland
PM Saint Pierre and Miquelon
PN Pitcairn
PR Puerto Rico
PS Palestinian Territory
PT Portugal
PW Palau
PY Paraguay
QA Qatar
RE Reunion
RO Romania
RS Serbia
RU Russian Federation
RW Rwanda
SA Saudi Arabia
SB Solomon Islands
SC Seychelles
SD Sudan
SE Sweden
SG Singapore
SH Saint Helena
SI Slovenia
SJ Svalbard and Jan Mayen
SK Slovakia
SL Sierra Leone
SM San Marino
SN Senegal
SO Somalia
SR Suriname
ST Sao Tome and Principe
SV El Salvador
SY Syrian Arab Republic
SZ Swaziland
TC Turks and Caicos Islands
TD Chad
TF French Southern Territories
TG Togo
TH Thailand
TJ Tajikistan
TK Tokelau
TL East Timor
TM Turkmenistan
TN Tunisia
TO Tonga
TR Turkey
TT Trinidad and Tobago
TV Tuvalu
TW Taiwan (Province of China)
TZ Tanzania, United Republic of
UA Ukraine
UG Uganda
UK United Kingdom
UM United States Minor Outlying Islands
US United States
UY Uruguay
UZ Uzbekistan
VA Holy See (Vatican City State)
VC Saint Vincent and the Grenadines
VE Venezuela
VG Virgin Islands, British
VI Virgin Islands, U.S.
VN Vietnam
VU Vanuatu
WF Wallis and Futuna
WS Samoa
YE Yemen
YT Mayotte
YU Yugoslavia
ZA South Africa
ZM Zambia
ZW Zimbabwe

The IP country codes are case-insensitive.

System language codes

Since we detect country codes by IP addresses, we can target potential buyers by their physical location only. Thus that method doesn’t allow us to recognize an Italian tourist in China, and this is where the method preferred browser language detection comes in.

Even if an Italian citizen visits China, most likely he has an Italian language support on his computer. Even if he is not an Italian, he probably speaks the Italian language anyways. Otherwise why could he install the Italian language support?

Get an advantage of this method and make a comma-separated list of allowed and disallowed system languages, provided by visitor’s browser.

The browser language codes list is case-insensitive. Below are system language codes for countries for your convenience.

Code Name
af Afrikaans
af-ZA Afrikaans (South Africa)
ar Arabic
ar-AE Arabic (U.A.E.)
ar-BH Arabic (Bahrain)
ar-DZ Arabic (Algeria)
ar-EG Arabic (Egypt)
ar-IQ Arabic (Iraq)
ar-JO Arabic (Jordan)
ar-KW Arabic (Kuwait)
ar-LB Arabic (Lebanon)
ar-LY Arabic (Libya)
ar-MA Arabic (Morocco)
ar-OM Arabic (Oman)
ar-QA Arabic (Qatar)
ar-SA Arabic (Saudi Arabia)
ar-SY Arabic (Syria)
ar-TN Arabic (Tunisia)
ar-YE Arabic (Yemen)
az Azeri (Latin)
az-AZ Azeri (Latin) (Azerbaijan)
az-AZ Azeri (Cyrillic) (Azerbaijan)
be Belarusian
be-BY Belarusian (Belarus)
bg Bulgarian
bg-BG Bulgarian (Bulgaria)
bs-BA Bosnian (Bosnia and Herzegovina)
ca Catalan
ca-ES Catalan (Spain)
cs Czech
cs-CZ Czech (Czech Republic)
cy Welsh
cy-GB Welsh (United Kingdom)
da Danish
da-DK Danish (Denmark)
de German
de-AT German (Austria)
de-CH German (Switzerland)
de-DE German (Germany)
de-LI German (Liechtenstein)
de-LU German (Luxembourg)
dv Divehi
dv-MV Divehi (Maldives)
el Greek
el-GR Greek (Greece)
en English
en-AU English (Australia)
en-BZ English (Belize)
en-CA English (Canada)
en-CB English (Caribbean)
en-GB English (United Kingdom)
en-IE English (Ireland)
en-JM English (Jamaica)
en-NZ English (New Zealand)
en-PH English (Republic of the Philippines)
en-TT English (Trinidad and Tobago)
en-US English (United States)
en-ZA English (South Africa)
en-ZW English (Zimbabwe)
eo Esperanto
es Spanish
es-AR Spanish (Argentina)
es-BO Spanish (Bolivia)
es-CL Spanish (Chile)
es-CO Spanish (Colombia)
es-CR Spanish (Costa Rica)
es-DO Spanish (Dominican Republic)
es-EC Spanish (Ecuador)
es-ES Spanish (Castilian)
es-ES Spanish (Spain)
es-GT Spanish (Guatemala)
es-HN Spanish (Honduras)
es-MX Spanish (Mexico)
es-NI Spanish (Nicaragua)
es-PA Spanish (Panama)
es-PE Spanish (Peru)
es-PR Spanish (Puerto Rico)
es-PY Spanish (Paraguay)
es-SV Spanish (El Salvador)
es-UY Spanish (Uruguay)
es-VE Spanish (Venezuela)
et Estonian
et-EE Estonian (Estonia)
eu Basque
eu-ES Basque (Spain)
fa Farsi
fa-IR Farsi (Iran)
fi Finnish
fi-FI Finnish (Finland)
fo Faroese
fo-FO Faroese (Faroe Islands)
fr French
fr-BE French (Belgium)
fr-CA French (Canada)
fr-CH French (Switzerland)
fr-FR French (France)
fr-LU French (Luxembourg)
fr-MC French (Principality of Monaco)
gl Galician
gl-ES Galician (Spain)
gu Gujarati
gu-IN Gujarati (India)
he Hebrew
he-IL Hebrew (Israel)
hi Hindi
hi-IN Hindi (India)
hr Croatian
hr-BA Croatian (Bosnia and Herzegovina)
hr-HR Croatian (Croatia)
hu Hungarian
hu-HU Hungarian (Hungary)
hy Armenian
hy-AM Armenian (Armenia)
id Indonesian
id-ID Indonesian (Indonesia)
is Icelandic
is-IS Icelandic (Iceland)
it Italian
it-CH Italian (Switzerland)
it-IT Italian (Italy)
ja Japanese
ja-JP Japanese (Japan)
ka Georgian
ka-GE Georgian (Georgia)
kk Kazakh
kk-KZ Kazakh (Kazakhstan)
kn Kannada
kn-IN Kannada (India)
ko Korean
ko-KR Korean (Korea)
kok Konkani
kok-IN Konkani (India)
ky Kyrgyz
ky-KG Kyrgyz (Kyrgyzstan)
lt Lithuanian
lt-LT Lithuanian (Lithuania)
lv Latvian
lv-LV Latvian (Latvia)
mi Maori
mi-NZ Maori (New Zealand)
mk FYRO Macedonian
mk-MK FYRO Macedonian (Former Yugoslav Republic of Macedonia)
mn Mongolian
mn-MN Mongolian (Mongolia)
mr Marathi
mr-IN Marathi (India)
ms Malay
ms-BN Malay (Brunei Darussalam)
ms-MY Malay (Malaysia)
mt Maltese
mt-MT Maltese (Malta)
nb Norwegian (Bokm?l)
nb-NO Norwegian (Bokm?l) (Norway)
nl Dutch
nl-BE Dutch (Belgium)
nl-NL Dutch (Netherlands)
nn-NO Norwegian (Nynorsk) (Norway)
ns Northern Sotho
ns-ZA Northern Sotho (South Africa)
pa Punjabi
pa-IN Punjabi (India)
pl Polish
pl-PL Polish (Poland)
ps Pashto
ps-AR Pashto (Afghanistan)
pt Portuguese
pt-BR Portuguese (Brazil)
pt-PT Portuguese (Portugal)
qu Quechua
qu-BO Quechua (Bolivia)
qu-EC Quechua (Ecuador)
qu-PE Quechua (Peru)
ro Romanian
ro-RO Romanian (Romania)
ru Russian
ru-RU Russian (Russia)
sa Sanskrit
sa-IN Sanskrit (India)
se Sami (Northern)
se-FI Sami (Northern) (Finland)
se-FI Sami (Skolt) (Finland)
se-FI Sami (Inari) (Finland)
se-NO Sami (Northern) (Norway)
se-NO Sami (Lule) (Norway)
se-NO Sami (Southern) (Norway)
se-SE Sami (Northern) (Sweden)
se-SE Sami (Lule) (Sweden)
se-SE Sami (Southern) (Sweden)
sk Slovak
sk-SK Slovak (Slovakia)
sl Slovenian
sl-SI Slovenian (Slovenia)
sq Albanian
sq-AL Albanian (Albania)
sr-BA Serbian (Latin) (Bosnia and Herzegovina)
sr-BA Serbian (Cyrillic) (Bosnia and Herzegovina)
sr-SP Serbian (Latin) (Serbia and Montenegro)
sr-SP Serbian (Cyrillic) (Serbia and Montenegro)
sv Swedish
sv-FI Swedish (Finland)
sv-SE Swedish (Sweden)
sw Swahili
sw-KE Swahili (Kenya)
syr Syriac
syr-SY Syriac (Syria)
ta Tamil
ta-IN Tamil (India)
te Telugu
te-IN Telugu (India)
th Thai
th-TH Thai (Thailand)
tl Tagalog
tl-PH Tagalog (Philippines)
tn Tswana
tn-ZA Tswana (South Africa)
tr Turkish
tr-TR Turkish (Turkey)
tt Tatar
tt-RU Tatar (Russia)
ts Tsonga
uk Ukrainian
uk-UA Ukrainian (Ukraine)
ur Urdu
ur-PK Urdu (Islamic Republic of Pakistan)
uz Uzbek (Latin)
uz-UZ Uzbek (Latin) (Uzbekistan)
uz-UZ Uzbek (Cyrillic) (Uzbekistan)
vi Vietnamese
vi-VN Vietnamese (Viet Nam)
xh Xhosa
xh-ZA Xhosa (South Africa)
zh Chinese
zh-CN Chinese (S)
zh-HK Chinese (Hong Kong)
zh-MO Chinese (Macau)
zh-SG Chinese (Singapore)
zh-TW Chinese (T)
zu Zulu
zu-ZA Zulu (South Africa)
We are hosted at SG Managed
2Checkout