The ad debug mode helps you (and us) to identify issues on your page that might interfere with displaying ads. The debug mode is especially useful if Display Conditions are not working as expected.

The issues below are often caused by broken code in other plugins or themes and are likely to cause issues not only with Advanced Ads. Fixing them is therefore in general advised.

Advanced Ads debug mode output

Example of an ad debug output

If you see one of the errors below, but are positive that everything is all right with your page and code then please contact us.

Enabling ad debug mode

You can find the debug mode in the Layout/Output meta box of the ad edit screen.

ad debug mode option

Once enabled, the output of the ad will be exchanged with the debug content.

Also, all display limitations for the ad will be ignored (display conditions, visitor conditions, expiry date).

The size of the debug ad is defined by the width and height you set for the ad and 300×250 if you didn’t set them. The content of the debug ad can be scrolled horizontally and vertically.

The debug mode does not work when the ad is delivered with cache-busting.

Issues & Fixes

Please find issues listed in debug mode and possible fixes below.

General debugging

The debug output lists some general information that help you to see if you are in fact looking at the right ad and whether the general issues are fine or not, e.g.

  • whether the ad is displayed on the page or not (if debug mode is off)
  • name and ID of the current post
  • name and ID of the ad
  • current ad group
  • current placement

First, you should check if these information are in general correct.

You can display the ad debug mode to admins only by adding the following line to your wp-confic.php.


Debugging Conditions

Advanced Ads debug mode: display and visitor conditions

Debugging display and visitor conditions is done using the appropriate tables.

You will find the conditions set with the ad options in tables with three columns. The first column is about the type of the condition. The second about the options set with the ad and the third (wp_the_query) about the environment the ad is embedded into and the options are checked against.

The conditions are (currently) cryptic, but should be readable enough to identify them. If you see a non-matching line with 0 and 1 or empty and 1, it can be an indicator that conditions are not matching and this is the reason why an ad is not displayed.

Current query is not identical to main query.

This warning might occur, when the main query, the one that determines which page you are currently looking at (a single post, an archive, etc.) is altered. This might be intended, but is still often a hint for a wrong usage of query_posts().

Example output:

Current query is not identical to main query.

 current querymain query
name featured-post

This means that you are on the page with the Featured Post post, but at the position where the ad is displayed you are technically on the page with the ID 2.

The table above is just an example. The query could be altered in many ways and so the information within the table are just a hint that might help a developer to find the place where the query is altered.

Possible solution

A possible cause of this problem is the use of query_posts() without closing it properly.

query_posts( 'page=2' );
while ( have_posts() ) : the_post();
echo '<li>';
echo '</li>';

This code loads the page with the ID 2 into the main query. In order to reset this change, the following line must be placed after the code above:


Please note that the usage of query_posts() is often not needed or can or should be replaced with WP_Query or a filter. The documentation of query_posts() lists all the alternatives and their consequences.

Current post is not identical to main post.

This warning might occur, when other posts than the current one are requested, but the developer didn’t close that request properly. This is very common among plugins and widget that show any type of featured posts (e.g., similar posts in the sidebar).

Note: Advanced Ads can automatically handle the consequences of this error in most cases. Still, errors might occur for some setups and solving this is highly recommended also for other plugins to work properly.

If this error occurs together with the wrong-query error above, fix the query error first. It might solve the post error as well.

Example output:

Current post is not identical to main post.
current post: Sample Page, ID: 2
main post: Featured Post, ID: 25

This means that you are visiting the Featured Post post or page, but at the position where the ad is displayed you are technically on the Sample Page.

Possible solution

A possible cause of this problem is the use of WP_Query() with the_post() but without wp_reset_postdata();

$the_query = new WP_Query( array('page_id' => 2) );

if ( $the_query->have_posts() ) {
echo '<ul>';
while ( $the_query->have_posts() ) {
echo '<li>' . get_the_title() . '</li>';
echo '</ul>';

This codes misses the following line behind it:


Please refer to the manual of WP_Query for more information.