Advanced Ads offers you a way to add a headline above your ads. You can choose if the Ad label should be displayed for all ads or only specific Placements.

While not mandatory, AdSense suggests labeling your ads with either “Advertisements” or “Sponsored Links”. Despite the AdSense program policies, you might want to add such an Advertisement label to reduce confusion between your editorial content and ads.

Usage

Enabling the Ad label above your ads

To activate the Ad label, go to Advanced Ads > Settings > General and enable the Ad label option. You can type your own phrase into the text field to customize it.

custom ad labels in advanced ads
You can customize your ad label with own words

If you use Google AdSense, please keep in mind that only “Advertisements” or “Sponsored Links” are allowed according to the program policies.

Ad label settings in the Placements

You can configure the position of your Ad label in the settings of a Placement. Not all Placements offer the option to set an advertisement label (e.g., the invisible Header Code Placement for setting Facebook Pixels or similar source code).

Go to Advanced Ads > Placements and click on show all options. You can enable or disable the Ad label individually for every Placement. The default option uses your general settings.

ad label options of Advanced Ads
Setting up an ad label in the Placement options

You can individually adjust the ad label position and align it to the left, center, or right side inside your layout. The default option uses the position you defined in the general settings.

Please note: the alignment of an ad label overrides an ad’s position, which you have configured in the Layout / Output settings of an ad unit.

Customizing the Ad label (for CSS professionals)

You can customize the style of your ad label with the use of some CSS. The styling of the label depends on your theme. If you are familiar with it, use the code snippets below to format the CSS and edit the PHP of your WordPress theme.

Use Advanced Ads Pro to style each ad, and its appearance more easily with the Custom Code feature directly in the Layout / Output options of an ad unit.

Useful CSS classes and rules

The default HTML markup looks like this:

<div class="prefix-adlabel">Advertisements</div>

Please note that the class attribute might be adjusted depending on the prefix option you set up in the general settings of Advanced Ads. prefix- is just the sample prefix and needs to be exchanged with the setting found in the ID prefix option.

You can use this class to apply custom CSS rules to the ad label.

Alignment

To float the label left, even when the ad is centered, adjust, and use the following CSS rule:

.prefix-adlabel { text-align: left; }

Font size

To make the font size smaller, use this rule:

.prefix-adlabel { font-size: 0.8em; }

Position

To move the position of the label below the ad, try something like this:

/* adjust the ad wrapper */
.prefix-top { 
position: relative; 
margin-bottom: 20px; // depending on size
}
/* label element */
.prefix-adlabel { position: absolute;
    bottom: -20px; // depending on size
    left: 0px;
}

Adjusting the label code or markup

You can adjust the markup of the label using the advanced-ads-custom-label  filter.

How to add a specific headline to AdSense ads

AdSense is very clear about headlines:

It’s important that visitors to your site are not misled in any way and are able to easily distinguish content from Google ads. This policy prohibits placing ads under misleading headings such as “resources” or “helpful links”. Publishers may only label ads with either “Advertisements” or “Sponsored Links”. No other variations are permitted.

This violation can be often seen in sidebars because widgets allow you to insert a headline by default. You can use one of the permitted advertisement labels now or just leave it blank. AdSense doesn’t require you to add a label if your ads can be distinguished from other content.

To enable labels for ads in other positions, you can use the following code in your theme’s functions.php. It will display the “Advertisement” heading above any AdSense ad.

// add "ad" headline before ads add_action( 'advanced-ads-output-final', 'my_advanced_ads_headline', 10, 2 ); function my_advanced_ads_headline( $output, $ad ){ // check if this is an AdSense ad if( $ad->type !== 'adsense' ){ return $output; } $headline = 'Advertisement'; $output = '<fieldset><legend>' . $headline . '</legend>' . $output . '</fieldset>'; return $output; }

You can remove the check for the AdSense ad to display the headline for other ad types as well. Just remove line 5 to 7.

Use the advanced-ads-output-inside-wrapper filter instead of advanced-ads-output-final if you want to display the label within the ad wrapper.

To change the headline, just modify the string in line 9.

Copy this code to your functions.php, and it should work automatically.

Adding labels to AdSense Auto ads

Many people use the Auto ads feature by AdSense. As described in this tutorial, you can let AdSense automatically choose where to place ads on your website.

Depending on the advertiser, these Auto ads might already contain an advertisement label. Often you can find a small overlay title “Ad” or similar on the bottom right of the ad. You can add your own ad label by adding some CSS definitions to Auto ads’ genuine CSS class google-auto-place.

The following code injects an advertisement label above every AdSense Auto ad. Just add it to the “Additional CSS” section of your WordPress theme’s customization settings. You can also insert this code directly into the style.css of your theme.

.google-auto-placed { font-size: 12px; font-family: "Arial",sans-serif; font-style: italic; } .google-auto-placed::before { content: "Advertisements"; }

Of course, you can change the font size and other settings by adjusting the CSS.

The following code injects the label after the ad:

.google-auto-placed::after { content: "Advertisements"; }