What is Ad Inserter plugin?
Ad Inserter is a free WordPress plugin for inserting ad codes, HTML, JavaScript, PHP, and tracking scripts into virtually any position on a WordPress page. With over 300,000 active installations and a 4.9-star rating on WordPress.org, it is one of the most capable free tools for ad placement — offering more position options, insertion logic, and code block flexibility than most paid alternatives.
Ad Inserter’s primary strength is the precision of its insertion positions: it can inject code after the Nth paragraph, before the last paragraph, between posts in an archive, inside widgets, after specific HTML elements, and in over 15 additional locations. This granularity makes it the preferred tool for bloggers who need in-content ad placement at specific positions relative to content structure. It also serves double-duty as a general code injection tool — header scripts, footer scripts, conversion pixels, chat widgets, and analytics code can all be managed through Ad Inserter rather than requiring a separate header/footer code plugin.
The Pro version (€20/year for 2 sites) adds geolocation targeting, ad rotation with groups, global ad excluder, automatic insertion rules, detailed impression and click statistics, AMP compatibility, and Google Analytics event tracking for ad clicks. For bloggers running display advertising who need reliable in-content placement without the complexity of a full ad manager, Ad Inserter’s free version is a remarkably complete solution.
Need Help With Ad Inserter Setup, Troubleshooting, or Customization?
Need help with Ad Inserter? Whether you are dealing with errors, broken functionality, styling problems, plugin conflicts, or advanced customization, we can help you fix the issue and get the plugin working properly on your WordPress site.
Get Ad Inserter Expert HelpKey Features
- Insert code/ads at 16+ positions: before/after content, after Nth paragraph, before last paragraph, between posts in archive, widgets, shortcodes, header, footer
- Supports all ad networks: AdSense, Ad Manager, Amazon, custom HTML/JS/PHP
- Black/whitelist by post type, category, post ID, user role, device
- Manual shortcode placement
- AMP support (Pro)
Pros & Cons
Pros
- Most flexible free ad placement plugin — 16+ distinct position options
- Serves as both ad manager and general code injection tool (header scripts, pixels)
- Remarkably capable free version compared to paid alternatives
Cons
- Interface is functional but dated — less polished than Advanced Ads
- Ad rotation and geolocation require Pro
Free vs Premium
Free: unlimited code blocks, all position types, device targeting, post/category conditions. Pro (€20/year): geolocation, ad rotation groups, statistics, AMP, Google Analytics integration.
Common Problems & Fixes
Ad Inserter code is not appearing at the configured position — the header script is not loading. How do I verify the code is outputting?
In Ad Inserter, each code block has an “Enabled” status — verify the block is enabled (not paused). Check the output position setting: for header scripts, select “Before “; for footer scripts, select “Before “. Use the Ad Inserter preview mode (the eye icon next to each block) to preview what the block outputs. If the block is enabled and positioned correctly but still not appearing: (1) page caching may be serving a cached page without the block — clear caches; (2) the block’s display conditions may exclude the current page; (3) verify the theme calls wp_head() and wp_footer() — plugins that inject code via these hooks depend on the theme implementing these standard WordPress functions.
An Ad Inserter code block set to display after the 3rd paragraph is appearing after the 1st paragraph or in unexpected positions. How do I fix paragraph counting?
Ad Inserter counts HTML
tags to determine paragraph position. Issues arise when: (1) the post content uses page builders that output div-based layouts rather than
tags — Ad Inserter cannot count paragraphs in non-standard HTML structures; (2) the post has very short paragraphs or block elements that are technically separate
tags but visually appear as one section; (3) a page caching plugin outputs the ad at a different position than the live rendering. Test on posts with standard paragraph structure. For page builder content, consider using a shortcode placement instead of auto-paragraph insertion.
A JavaScript tracking pixel added in Ad Inserter is not firing — the analytics event is not being recorded. How do I debug script execution?
Use browser DevTools (Network tab) to verify the tracking pixel URL is being requested. If no network request appears: (1) the Ad Inserter block containing the script may have an error that prevents execution — check the JavaScript console for syntax errors; (2) an ad blocker or privacy extension is blocking the script — test in a clean browser without extensions; (3) the position setting may place the script before the page’s required libraries load — for scripts that depend on jQuery or other libraries, use “Before ” placement to ensure libraries are loaded first.
Customization & Developer Notes
How do I use Ad Inserter to insert different ads on posts vs. pages?
In Ad Inserter, each code block has a “Post Types” filter at the bottom of the settings. Select “Posts” only for post-specific ads and “Pages” only for page-specific ads. Blocks configured for Posts will not appear on Pages and vice versa. For more granular targeting (specific categories, specific post IDs, or posts with certain tags), use the Inclusion/Exclusion lists in the block settings. Category-specific ad placement is particularly useful for monetizing high-traffic category pages with targeted advertiser content.
How do I insert an ad between the 2nd and 3rd posts in a WooCommerce shop or blog archive?
In Ad Inserter, create a new code block with the ad code. Set the position to “Between Posts” and configure the insertion to appear after the 2nd post in the loop. This inserts the ad code between post/product items in archive, shop, and category listing pages. Note that this works with standard WordPress post loops — WooCommerce product grids that use custom CSS Grid or Flexbox layouts may require theme-level integration for reliable inter-product ad insertion.
Frequently Asked Questions
Is Ad Inserter or Advanced Ads better for a WordPress blog?
For most blogs needing reliable in-content ad placement, Ad Inserter’s free version is more than sufficient and provides more position granularity than Advanced Ads free. Advanced Ads is better when visitor targeting (device, location, user role), ad rotation, and performance analytics are needed — features that require Advanced Ads Pro. For straightforward AdSense or display ad placement in specific content positions, Ad Inserter’s free tier is the more capable no-cost solution.
Can Ad Inserter be used for non-ad code insertion (tracking pixels, chat widgets)?
Yes — Ad Inserter is widely used as a general-purpose code injector, not just for ads. Tracking pixels (Facebook Pixel, Google Tag Manager, TikTok Pixel), live chat widgets (Intercom, Drift, Crisp), conversion tracking scripts, and heatmap tools (Hotjar, Microsoft Clarity) are all commonly managed through Ad Inserter. Managing all injected code in one place (rather than scattered across theme files and individual plugin settings) makes maintenance and debugging significantly easier.
Can Ad Inserter break after updates?
Yes, that can happen, especially on older sites with many plugins. This usually happens when the plugin, theme, and add-ons are updated out of sequence. In most cases, testing on staging catches the issue before it reaches the live site. From experience, backups and changelog reviews save a lot of cleanup time.
What should I check before installing Ad Inserter?
Start by checking whether another plugin already does the same job. In most cases, overlap is what creates avoidable conflicts and performance issues. A common issue is installing a plugin because it looks convenient without checking the stack first. From experience, a short compatibility review avoids most of the pain later.