WP Ad InserterFree ad manager with geotargeting, rotation and CTR tracking
A WordPress ad management plugin. Insert Google AdSense, affiliate banners or your own HTML, JavaScript and PHP in more than 30 places, show each ad by visitor country, region, city, device, language, referrer and time, rotate ads, track clicks and CTR, and keep it all working behind a page cache. Everything is included and nothing is locked.
No cookies and no third-party scripts from the plugin
Updates inside WordPress
30+ad positions
25targeting rules
0cookies set on your visitors
GPLv2 or later, all features free
Paste the code of any ad network or your own banner
Google AdSense
Google Ad Manager
Amazon Native Shopping Ads
Infolinks
Affiliate banners
Your own HTML, JS and PHP
The free features other plugins sell
Copy the code from your ad network, paste it, set the rules - no visual block builder to fight with.
More than 30 ad positions
Put an ad where it earns: inside the text, between posts, at the top of the page, in the footer or next to the comments. Content positions count paragraphs, headings and images from the start, from the end or pick a random one, and later ads never shift the numbering of earlier ones.
Before and after content, paragraph, heading and image
Before and after the Loop and before the N-th post of a list
Between any two HTML elements, with regular expressions
Top of the page, footer, comment form and a widget
Most offers are meant for particular countries. Show or hide a campaign by country, continent, region, city or a radius around a point. The location comes from a GeoIP database stored on your own server, so visitor addresses never leave your site.
Country database included, refreshed from DB-IP or MaxMind
Optional city-level database for cities, regions and radius
Uses the country header of your CDN when there is one
Different ads for different people. Choose computers, tablets and phones, catch the Italian tourist with the browser language, react to the page a visitor came from or to a URL parameter, and keep ads away from logged-in users or show them only to a given role.
Device, browser language, login status and user roles
Referrer, URL parameters (UTM), cookies and user agent
Match the ad to the post. Limit a campaign to categories, tags, keywords found in the text, post types, authors, post IDs, URL patterns, the age of a post or its length, and decide which page types may show it.
Categories, tags and whole-word keywords
Post types, authors, post age and minimum word count
Posts, pages, excerpts, homepage, archives and search results
Run an ad on certain weekdays, during certain hours or between a start and an end date. Hours are checked in the visitor’s own time zone, so “18-22” means evening for everyone, wherever they are.
A full-page cache serves the first visitor’s ad to everybody and breaks targeting. Switch on browser mode for a campaign and the ad is chosen for every visitor, with an optional fast endpoint that skips your theme and plugins. Positions and post rules work with any cache as they are.
Works with caching plugins, Cloudflare and server caches
Put several ads in one campaign and rotate them, then see which one works. Every campaign and every ad of a rotation has its impressions, clicks and click-through rate, and the best ad is marked once it has enough views. Visitors are counted once a day and bots are ignored.
Ad code is HTML, JavaScript and sometimes PHP, and the editor highlights all of it. Run PHP inside an ad when you need to. Errors are caught and shown to you with the campaign ID, never to visitors. Add code to the head of the page with a separate field.
Build a few campaigns for one kind of site, tick them in the list and export them to a file. Import the file on any other site and the whole set is there, with new IDs and empty statistics. It is also the simplest backup of your ads.
Select any campaigns, such as #1 and #3, and export them together
Every value is checked on import, and Execute PHP is always switched off
Put a campaign wherever a post, a page or a theme can hold it. The Ad campaign block of the block editor shows the ad at that place with all the rules of the campaign. A shortcode, a widget and a PHP line cover everything else.
Ad campaign block for the block editor
Shortcode and widget, and a PHP line for templates
A Manual position that shows the ad only where you put it
Float an ad at the top or the bottom of the screen or in a popup, with a delay, a close button and a memory of the closing, and count it only when it is shown. Put ads around products, the Add to cart form, the product list, the cart and the checkout of a WooCommerce shop.
Keep ads under control. Skip an ad when its spot or the whole page already has enough, switch ads off on a single post with one checkbox, and publish your ads.txt from the Settings page, where every line is checked.
Every ad is an independent campaign. You set it up once and it stays out of your way.
Paste the ad code
HTML, CSS, JavaScript and PHP in a real code editor. Add several ads divided by one separator and they rotate.
Choose where it appears
Before or after content, after the 3rd paragraph, before the last image, between posts, at the top of the page, in the footer, in a widget, as a popup or with a shortcode.
Decide who sees it
Country, region, city, device, language, referrer, post, category, tag, keyword, weekday and hour. Everything is optional.
1 · Top of the page
2 · Before content
3 · After paragraph 2
4 · After content
5 · Widget
6 · Site footer
Insert ads anywhere in WordPress: more than thirty positions, no theme editing
Content positions work on the text of every post. Other positions use the places that WordPress, your theme and WooCommerce already provide, so you never edit a template.
Before or after the N-th paragraph, heading or image, from the start, from the end or at random
Before and after the Loop, and before a given post in the Loop
Between any two HTML elements, with regular expressions
Comment form (five positions), top of the page, site footer and a widget
Sticky bars, a popup and eight WooCommerce positions
A block, a shortcode and a PHP snippet for anything else
Other ad plugins offer these features in paid versions. WP Ad Inserter provides them all for free.
City, region, continent and radius targeting
Weekday, hour and date schedules in the visitor’s time zone
Ads that work behind full-page caches
Impressions, clicks and CTR for every ad
Rotation with a statistics table per ad
Sticky bars and popups with a close button
WooCommerce positions
User role, login, referrer and URL parameter rules
Execute PHP inside the ad, with error catching
Export and import of selected campaigns
A block for the block editor, a shortcode and a widget
An ads.txt editor with validation
Counting by paragraph, heading or image from the end or at random
Between any two HTML elements, with regular expressions
Unlimited campaigns, ads and sites
No license key, no account, no trial
Built for speed, privacy and safety
An ad plugin runs on every page of your site, so it has to behave.
Light on the server
The rules are checked while the page is generated. The GeoIP database is opened only when a campaign needs it, and a counter is one atomic database query that is not loaded on page views.
Private by design
No cookies, no third-party scripts and no visitor addresses sent anywhere: the location is found on your own server.
Audited and hardened
Every request is checked with nonces and capabilities, imported files are validated field by field, and PHP in ads is limited to administrators, and on multisite to super admins.
Updates in WordPress
New versions appear on the Plugins page and install with one click, like any plugin. The code is open under the GPL, so you can read every line.
Popular ad setups
Six requests that come up again and again. Each one is a single campaign.
AdSense after the second paragraph, on phones only
Yes. WP Ad Inserter is free software under the GNU General Public License, version 2 or later. There are no license keys, no limits on campaigns or ads and no locked features: city and region targeting, schedules, click tracking, popups, import and export and everything else on this page are in the plugin you download.
How do I insert ads into WordPress posts without coding?
Create a campaign, paste the ad code you got from your ad network or affiliate program, set the position to “After paragraph” and the number to 2, and save. The ad appears after the second paragraph of every post. See the quick start.
Where can I place ads in WordPress with this plugin?
There are more than thirty positions: before and after the content, before or after the N-th paragraph, heading or image (counted from the start, from the end or chosen at random), between two HTML elements, before a post in a list, at the top of the page, in the footer, around the comment form, in a widget, around WooCommerce products, as a sticky bar or a popup, and anywhere else with a shortcode, a block or a PHP line. See all positions.
Can I show ads only to visitors from certain countries, regions or cities?
Yes. In the campaign enter ISO country codes, continents, regions, city names or a radius around a point and choose “Display for” or “Hide for”. The visitor’s location is found from the IP address with a GeoIP database that is stored on your own server, so no visitor address is sent to a third party. If the location cannot be found, a “Display for” rule hides the ad and a “Hide for” rule shows it. See targeting.
Can I show different ads on mobile and desktop?
Yes. Each campaign can be limited to computers, tablets or phones, with “Display on” or “Hide on”. Create one campaign for desktop and another for phones, each with its own ad code.
Does it work with Google AdSense and other ad networks?
It works with any network whose ad is a piece of HTML or JavaScript: Google AdSense, Google Ad Manager, Amazon Native Shopping Ads, Infolinks, affiliate banners and your own code. Paste the code as the network gives it. The plugin only decides where and for whom it is printed, so follow the policies of your ad network.
Can I rotate several ads in one place?
Yes. Put several ads into one campaign and divide them with <!--more-->. With Rotate on, a random ad is chosen every time a page is generated. With Rotate off, every post keeps its own ad. The Statistics tab shows the impressions, clicks and CTR of every ad, so you can see which one works best.
Does it track ad clicks and CTR?
Yes. The plugin counts impressions and clicks for every campaign and for every ad of a rotation and shows the CTR. Impressions are counted once per visitor per day and bots are ignored. A click is counted when a visitor clicks a link inside the ad, which covers banners and text ads with your own links. Scripts of ad networks that draw their ad inside an iframe, such as AdSense, hide their clicks from the page. For them the plugin shows impressions only, and the network’s own report has the clicks. See impressions and clicks.
Does it work with caching plugins?
Yes. Positions and the post rules work with any cache. The visitor rules (country, device, language, time, rotation, limits) are normally evaluated when WordPress generates a page, and a full-page cache would then serve the first visitor’s choice to everyone. Switch on “Load this ad in the browser” for a campaign and the ad is chosen for every visitor instead, with an optional fast endpoint that does not load your theme and other plugins. The impression and click counters work with caches too. Read page caching for details and trade-offs.
Can I use PHP in my ads?
Yes. Switch on “Execute PHP” in the campaign and write normal PHP between <?php and ?> tags next to your HTML. Errors and exceptions are caught and shown to you with the campaign ID. On a multisite network only super admins can enable or edit PHP.
Can I show sticky ads or popups?
Yes. Choose the position “Sticky bar at the top”, “Sticky bar at the bottom” or “Popup”. The ad floats above the page with a close button. You set the delay and for how many hours it stays closed. The ad is counted only when it is shown. Many ad networks restrict ads that cover content, so check their rules before you use these positions.
Does it work with WooCommerce?
Yes. There are positions before and after a product, before and after the Add to cart form, before and after the product list, before the cart and before the checkout form. Add the post type product to the campaign’s post type rule to show an ad only for products.
Can I manage ads.txt with it?
Yes. The Settings page has an ads.txt editor. Paste the lines your ad networks give you. Lines that do not follow the format are reported and are not published. The file is served at /ads.txt of your site while no real ads.txt file exists in its root folder.
Can I reuse the same campaigns on other sites?
Yes. Tick the campaigns in the list, press “Export selected” and import the file on another site. This is how you keep ready-made sets of ads for different kinds of sites. Imported campaigns get new IDs and empty statistics, and Execute PHP is always switched off in them for safety. See import and export.
Is there a block for the block editor?
Yes. Add the “Ad campaign” block to a post, choose a campaign and the ad is shown at that place with all the rules of the campaign. There are also a shortcode, a widget and a PHP line for theme templates.
How accurate is GeoIP?
The location is found by the visitor’s IP address in a database, which is reliable for most visitors but never perfect: VPNs, mobile carriers and proxies can show another country. The plugin includes a country database from DB-IP, can refresh it from DB-IP Lite or from MaxMind GeoLite2 (with your own free license key) and can use the country header of your CDN, such as Cloudflare.
Will it slow my site down?
The plugin does its work while a page is generated: it checks the rules of your campaigns and inserts the ad code. The GeoIP database is opened only when a campaign needs it. The counters send one small request from the visitor’s browser after the page has loaded. Ads themselves are your ad networks’ code and load as they would without the plugin.
Does it set cookies and what data does it collect?
The plugin sets no cookies. The counters keep numbers per campaign on your site and a small list of campaign IDs with timestamps in the visitor’s browser storage. Visitor addresses are used only on your server to find the location and are not sent anywhere. The scripts of your ad networks are a different matter: they may set cookies, and your consent notice must cover them.
Why is it not in the WordPress.org plugin directory?
It is distributed from this site. Updates appear on the Plugins page of your WordPress admin and install with one click, like any other plugin update.
Is it the same as the plugin called “Ad Inserter”?
No. WP Ad Inserter is an independent plugin made by CyberSEO.net and has no connection to other plugins with similar names.
How do I remove it completely?
Switch on “Delete plugin data on uninstall” on the Settings page, then deactivate and delete the plugin. Campaigns, settings, counters, the ads.txt text and the downloaded GeoIP files are removed.
Get WP Ad Inserter
Free for any number of sites. Requires WordPress 6.0 or newer and PHP 7.4 or newer.