Plugin Directory

Test out the new Plugin Directory and let us know what you think.

Ad Inserter

Insert any advert or HTML/Javascript/PHP code into WordPress. Perfect for all kinds of ads. 16 code blocks, many insertion options and features.


  • Added support for uppercase {country_ISO2} and lowercase {country_iso2} tag (Pro only)
  • Removed inclusion of dummy css and js file
  • Bug fix: Client-side dynamic blocks were not enabled if not using W3 Total Cache


  • Added support for client-side rotation (works with caching)
  • Added support for server-side rotation with W3 Total Cache
  • Added support for client-side country detection (works with caching, Pro only)
  • Added support for server-side country detection with W3 Total Cache (Pro only)
  • Added debugging functions to measure plugin processing time
  • Added option to black/white-list IP addresses (Pro only)
  • Added option for fallback code when scheduling between dates expires (Pro only)
  • On multisite installations Ad Inserter debug menu item on sites is available only if settings page is enabled
  • Added option for multisite installations to use Ad Inserter settings of main site for all blogs
  • Added flags to country list (Pro only)
  • Bug fix: Code preview did not work if WordPress was installed in a folder
  • Few minor bug fixes and cosmetic changes


  • Delayed display moved to Misc group
  • Added option for scheduling to insert code only between specified dates (Pro only)
  • Added option for Geo targeting (Pro only)
  • Few minor bug fixes and cosmetic changes


  • Added support to filter subpages created by the <!--nextpage--> tag
  • Added option to import block name (Pro only)
  • Cookie deleted only when it exists and debugging is disabled
  • Few minor bug fixes


  • Cookie created only when debugging is enabled
  • Few minor bug fixes


  • Bug fix: Cursor position always at the end of block name
  • State of debugging functions saved to cookie
  • Few minor bug fixes


  • Debugging functions in admin toolbar available only for administrators
  • Added option to hide debugging functions in admin toolbar
  • Added shortcode for debugger
  • Few minor bug fixes


  • Changed javascript version check to get plugin version from the HTML page
  • Added warning if old cached version of CSS file is loaded on the settings page
  • Added warning if version query parameter for js/css files is removed due to inappropriate caching


  • Bug fix: Shortcodes called by name were not displayed


  • Redesigned user interface
  • Added many debugging tools for easier troubleshooting
  • New feature: Code preview tool with visual CSS editor
  • New feature: Label inserted blocks
  • New feature: Show available positions for automatic insertion
  • New feature: Show HTML tags in posts/static pages
  • New feature: Log Ad Inserter processing
  • Improved loading speed of the settings page
  • Improved block insertion processing speed
  • Added support to avoid inserion near images, headers and other elements
  • Added option to avoid insertion in feeds
  • Added option to display code blocks only to administrators
  • Added option for publishig date check for display positions Before/After Content
  • Added option for server-side device check for header and footer code
  • Added option for maximum page/post words
  • Added option for maximum paragraph words
  • Added option to black/white-list post IDs
  • Added option to black/white-list url query parameters
  • Added warning if the settings page is blocked by ad blocker
  • Added warning if old cached version of javascript is loaded on the settings page
  • Added support for multisite installations to disable settings, widgets and exceptions on network sites (Pro only)
  • Block names can be edited by clicking on the name
  • Filters now work also on posts and single pages
  • CSS code for client-side detection moved to inline CSS
  • Bug fix: Minimum user roles for exception editing was not calculated properly
  • Bug fix: Server-side detection checkbox was not saved properly
  • Many other minor bug fixes, code improvements and cosmetic changes


  • Bug fix: Shortcodes did not ignore post/static page exceptions
  • Slightly redesigned user interface
  • Excerpt/Post number(s) renamed to Filter as it now works on all display positions
  • Widget setting removed from Automatic display to Manual display section
  • Added support to disable widgets (standalone checkbox in Manual display)
  • Added call counter/filter for widgets
  • Added support to edit CSS for predefined styles
  • Few other minor bug fixes, code improvements and cosmetic changes


  • Bug fix: Block code textarea was not escaped
  • Added checks for page types for shortcodes
  • Added support for Before/After Post position call counter/filter
  • Few minor cosmetic changes


  • Bug fix: Display on Homepage and other blog pages might get disabled - important if you were using PHP function call or shortcode (import of settings from 1.6.4)
  • Few minor cosmetic changes
  • Requirements changed to WordPress 4.0 or newer
  • Added initial support for Pro version


  • Fixed bug: Wrong counting of max insertions
  • Change: display position Before Title was renamed to Before Post
  • Added support for display position After Post
  • Added support for posts with no <p> tags (paragraphs separated with \r\n\r\n characters)
  • Added support for paragraph processing on homepage, category, archive and search pages
  • Added support for custom viewports
  • Added support for PHP function call counter
  • Added support to disable code block on error 404 pages
  • Added support to debug paragraph tags


  • Fixed bug: For shortcodes in posts the url was not checked
  • Optimizations for device detection


  • Removed deprecated code (fixes PHP 7 deprecated warnings)
  • Added support for paragraphs with div and other HTML tags (h1, h2, h3,...)


  • Removed deprecated code (fixes PHP Fatal error Call to a member function get_display_type)
  • Added support to change plugin processing priority


  • Fixed bug: For shortcodes in posts the date was not checked
  • Fixed error with some templates "Call to undefined method is_main_query()"
  • Added support for minumum number of page/post words for Before/After content display option
  • Added support for {author} and {author_name} tags


  • Added support for client-side device detection
  • Many code improvements
  • Improved plugin processing speed
  • Removed support for deprecated tags for manual insertion {adinserter n}
  • Few minor bug fixes


  • Fixed notice "Undefined index: adinserter_selected_block_" when saving page or post


  • Fixed notice "has_cap was called with an argument that is deprecated since version 2.0!"
  • Few minor bug fixes and code improvements
  • Added support to blacklist or whitelist url patterns: /url-start*. url-pattern, *url-end
  • Added support to define minimum number of words in paragraphs
  • Added support to define minimum user role for page/post Ad Inserter exceptions editing
  • Added support to limit insertions of individual code blocks
  • Added support to filter direct visits (no referer)


  • Fixed Security Vulnerability: Plugin was vulnerable to Cross-Site Scripting (XSS)
  • Few bug fixes and code improvements


  • Few bug fixes and code improvements
  • Added support to export and import all Ad Inserter settings


  • Many code optimizations and cosmetic changes
  • Header and Footer code blocks moved to settings tab (*)
  • Added support to process shortcodes of other plugins used in Ad Inserter code blocks
  • Added support to white-list or black-list individual urls
  • Added support to export and import settings for code blocks
  • Added support to specify excerpts for block insertion
  • Added support to specify text that must be present when counting paragraphs


  • Fixed Security Vulnerability: Plugin was vulnerable to a combination of CSRF/XSS attacks (credits to Kaustubh Padwad)
  • Fixed bug: In some cases deprecated widgets warning reported errors
  • Added support to white-list or black-list tags
  • Added support for category slugs in category list
  • Added support for relative paragraph positions
  • Added support for individual code block exceptions on post/page editor page
  • Added support for minimum number of words
  • Added support to disable syntax highlighting editor (to allow using copy/paste on mobile devices)


  • Fixed bug: Widget titles might be displayed at wrong sidebar positions
  • Change: Default code block CSS class name was changed from ad-inserter to code-block to prevent Ad Blockers from blocking Ad Inserter divs
  • Added warning message if deprecated widgets are used
  • Added support to display blocks on desktop + tablet and desktop + phone devices


  • Few fixes to solve plugin incompatibility issues
  • Added support to disable all ads on specific page


  • Added support to display blocks on all, desktop or mobile devices
  • Added support for new widgets API - one widget for all code blocks with multiple instances
  • Added support to change wrapping code CSS class name
  • Fixed bug: Display block N days after post is published was not working properly
  • Fixed bug: Display block after paragraph in some cases was not working propery


  • Fixed bug: Code blocks configured as widgets were not displayed properly on widgets admin page


  • Added support to skip paragraphs with specified text
  • Added position After paragraph
  • Added support for header and footer scripts
  • Added support for custom CSS styles
  • Added support to display blocks to all, logged in or not logged in users
  • Added support for syntax highlighting
  • Added support for shortcodes
  • Added classes to block wrapping divs
  • Few bugs fixed


  • Fixed bug: missing echo for PHP function call example


  • Added option for no code wrapping with div
  • Added option to insert block codes from PHP code
  • Changed HTML codes to disable display on specific pages
  • Selected code block position is preserved after settings are saved
  • Manual insertion can be enabled or disabled regardless of primary display setting
  • Fixed bug: in some cases Before Title display setting inserted code into RSS feed


  • Added option to insert ads also before or after the excerpt
  • Fixed bug: in some cases many errors reported after activating the plugin
  • Few minor bugs fixed
  • Few minor cosmetic changes


  • Fixed blank settings page caused by incompatibility with some themes or plugins


  • Added option to insert ads also on pages
  • Added option to process PHP code
  • Few bugs fixed


  • Number of ad slots increased to 16
  • New tabbed admin interface
  • Ads can be manually inserted also with {adinserter AD_NUMBER} tag
  • Fixed bug: only the last ad block set to Before Title was displayed
  • Few other minor bugs fixed
  • Few cosmetic changes


  • Fixed problem: || in ad code (e.g. asynchronous code for AdSense) causes only part of the code to be inserted (|| to rotate ads is replaced with |rotate|)


  • Fixed bug: manual tags in posts lists were not removed
  • Added position Before title
  • Added support for minimum number of paragraphs
  • Added support for page display options for Widget and Before title positions
  • Alignment now works for all display positions


  • Fixed bug for {search_query}: When the tag is empty {smart_tag} is used in all cases
  • Few changes in the settings page


  • Fixed error with multisite/network installations


  • Fixed bug in Float Right setting display


  • Added option to manually display individual ads
  • Added new ad alignments: left, center, right
  • Added {search_query} tag
  • Added support for category black list and white list


  • HTML entities for {title} and {short_title} are now decoded
  • Added {tag} to display the first tag


  • Fixed bug with rotating ads


  • Added support for rotating ads


  • Added support for different sidebar implementations


  • Initial release

Requires: 4.0 or higher
Compatible up to: 4.7.1
Last Updated: 2 weeks ago
Active Installs: 40,000+


4.9 out of 5 stars


35 of 35 support threads in the last two months have been marked resolved.

Got something to say? Need help?


Not enough data

1 person says it works.
0 people say it's broken.

100,1,1 100,2,2
100,1,1 100,3,3
100,1,1 100,1,1 100,1,1
100,2,2 100,1,1
100,1,1 100,2,2 100,1,1 100,2,2 100,1,1
100,1,1 100,1,1
100,1,1 100,1,1 100,1,1
100,1,1 100,1,1 100,2,2 100,1,1
100,1,1 100,1,1 100,1,1 100,2,2
100,1,1 100,1,1
100,1,1 100,1,1 100,2,2
100,2,2 100,1,1 100,2,2
100,1,1 100,1,1
100,1,1 100,3,3 100,1,1 100,1,1 100,1,1
100,2,2 100,1,1
100,3,3 50,2,1 100,2,2 100,1,1 100,1,1
100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,2,2 100,2,2 100,1,1 100,1,1
100,1,1 100,1,1 100,1,1 100,1,1