Press enter to see results or esc to cancel.


Ad Inserter has many debugging functions that can help you to diagnose the problem when you don’t see your ads at expected positions. When you are logged in as administrator each post and page has a WordPress admin toolbar on the top with Ad Inserter menu item. If you don’t see it check WordPress Users > Your profile and make sure Show Toolbar when viewing site is checked. Check also Ad Inserter plugin settings (tab / Debugging) and make sure Debugging functions in admin toolbar is checked.

ad inserter debugging functions

Make sure caching is disabled while debugging!

Example of page with enabled debugging functions Label BlocksShow Positions and Show HTML tags:

ad inserter debugging

Debugging Tools widget

It may happen that your theme does not not support the toolbar or it is not displayed for some other reason. In such case you can use Ad Inserter Debugging Tools widget which has the same menu items. Simply drag Ad Inserter widget into the sidebar and select Debugging Tools. Of course, you still need to be logged in as administrator to see the widget.

ad inserter widget debugging tools

Debugging functions

Label Blocks

Each inserted block is labeled with a thin red border and colored bar with block number, block name (including rotation option name if rotation is used), viewport name if using client-side device detection and counters. If you see only block label then this means that the block with your code is inserted but the code doesn’t display anything.

ad inserter debugging labeled blocks

Label colors

  •  Normal block
  •  Hidden block because of client-side device detection
  •  Block with AMP separator on AMP page
  •  Header and footer code, client-side insertion scripts
  •  Block with ad blocking action
  •  Ad blocking replacement block, scheduling fallback block
  •  Block with client-side black or white list check
  •  Block in Ajax request
  •  AdSense Auto ads
  •  AdSense ads with no slot size

Label counters

Each labeled block shows also various counters that can be used for filtering of insertions. Available counters:

  • N = Block counter
  • C = Content processing (the_content) counter
  • X = Excerpt processing (the_excerpt) counter
  • B = Before post (loop_start) counter
  • A = After post (loop_end) counter
  • W = Widget counter
  • P = PHP function call counter

Show Positions

Debugging function Show Positions labels every available position for automatic insertion that is supported by the theme.

All paragraph positions are shown according to the selected paragraph counting settings (Show Positions sub-menu) and show paragraph number and number of paragraph words. 

All other positions show also processing counter (hook call counter) unless it is 1 (the first call). You can use this number for insertion filtering.

ad inserter debugging show positions

Show HTML tags

Debugging function Show HTML tags labels most HTML tags that are important to determine parameters for paragraph counting.

ad inserter debugging html tags

Disable insertion

Use this function to temporarily disable insertion of code blocks – everything else on the page will look like the code blocks were processed and inserted.

Ad Blocking Status

When this function is enabled you will see a bar below the toolbar showing the status of ad blocking detection: whether ad blocking is detected, whether action is enabled, whether action cookie is present and how many page views were already counted (if used). You can click on the bar to delete ad blocking detection cookies. Ad blocking detection needs to be enabled to use this function.

ad inserter ad blocking debugging status

Simulate Ad Blocking

With this function you can simulate and test ad blocking detection without actual ad blocking software. Ad Inserter will behave as there is ad blocking present. Of course, no ads will be blocked, only plugin ad blocking functions will be triggered when the page is loaded. Ad blocking detection needs to be enabled to use this function.

Log Processing

Use this function to log insertion process in order to determine why some code block was not inserted. The log is added as HTML comment at the end of the page – check page source. 

Processing Log Widget

Place Processing Log widget into some widget area or sidebar to see insertion process including basic WordPress page and Ad Inserter data (User status, Page Type, Post ID, Url, Referer, etc). With this widget you can also check saved block settings and client-side viewport name. Example of Log Processing debugging function and processing log shown in the widget:

ad inserter widget processing log

More detailed processing log with detailed debugging info is shown as HTML comment at the bottom of page source.

Code Preview

Click on the Preview button below code editor for each code block to see how the ad or code will look like. On the preview window click on the Highlight button to highlight the code. If you don’t see anything displayed here it is very likely that the code is not working properly. Here you can also adjust alignment and style for code block. Of course, blank AdSense blocks are a common issue – it may happen that AdSense code will not display ads in the preview window.

ad inserter code preview highlighted

General debugging information

Make sure caching is disabled while debugging!

All debugging functions you enable will be visible only to you unless you enable Remote debugging and other users use debugging url parameters on your website. Post/page debugging works by adding url parameters to the url (web address). Debugging settings are also stored into cookie. The following url parameters are available:

  • Label Blocks: ai-debug-blocks=1 (use ai-debug-blocks=0 to turn it off)
  • Show Positions: ai-debug-positions=BLOCK_NUMBER, 0 means default counting of paragraphs with p tags, number means block number to see paragraph counting as configured for the block (use ai-debug-positions= to turn it off)
  • Show HTML tags: ai-debug-tags=1 (use ai-debug-tags=0 to turn it off)
  • Disable insertion: ai-debug-no-insertion=1 (use ai-debug-no-insertion=0 to turn it off)
  • Log Processing: ai-debug-processing=1 (use ai-debug-processing=0 to turn it off)
  • PRO Country test: ai-debug-country=XX (replace XX with country ISO Alpha-2 code)
  • PRO IP address test: ai-debug-ip-address=IP_ADDRESS
  • Ad blocking simulation: ai-debug-adb=1 (use ai-debug-adb=0 to turn it off)
  • Ad blocking detection status: ai-debug-adb-status=1 (use ai-debug-adb-status=0 to turn it off)

Country test and IP address test work only when you have enabled debugging on some page and debugging cookie is created.

When browsing other pages on the website debugging settings are temporarily saved (for the session). To disable all debugging functions click on the Ad Inserter top menu item in the toolbar (or use url parameter ai-debug=0)

If you see only block label (bar with block name) then this means that the block with your code is inserted but the code doesn’t display anything.

Global debugging settings

Global debugging settings are located on plugin settings tab ⚙ / tab Debugging

ad inserter plugin settings

When you are logged in as administrator each post or page has a WordPress admin toolbar on the top with Ad Inserter menu item. If you don’t see admin toolbar on the top go to WordPress Users > Your profile and make sure Show Toolbar when viewing site is checked. If you don’t see admin toolbar you can try to enable Force showing admin toolbar when viewing site.

Make sure Debugging functions in admin toolbar is checked (there is a separate settings Debugging functions on mobile screens for admin toolbar on mobile screens). This option will add Ad Inserter debugging menu with debugging functions.

ad inserter settings debugging

Remote debugging enables other people using url parameters to see your pages with debugging data: debugger widget, labeled blocks, positions for automatic insertion, labeled tags and processing log. For logged in administrators debugging is always enabled.

Enable this option to allow other people to see debugging data in order to help you to diagnose issues with Ad Inserter.