Category Archives: Wordpress

How To Fix The Yellow Background Box In Adsense – The Correct Way

Sometimes when you place a Google Adsense ad on your website you will see a light yellow background behind the ad, or you might see the yellow box before the Google ad loads to fill up the space. In most cases the ad will eventually cover the yellow background box, except for a few rare occasions or if you are using a responsive ad, or an ad block that displays in various sizes

What you are seeing is some CSS code from your website theme that is being used incorrectly by the Adsense code. Specifically, the ‘ins’ tag in the Adsense code is reading the settings from your theme, but the only reason the ad is using it, is because the ‘ins class=”adsbygoogle”…’ is not defined by the Google Adsense code, or by your own theme.

How To Fix The Yellow Background In Adsense – The Correct Way

Many other websites tell you how the you fix the yellow box background issue by changing the color of the ‘ins’ tag in your css file, but that is not the correct way to go about fixing it.

What you really want to do is define the entire ‘ins class=”adsbygoogle”…’ tag so that your default ‘ins’ is left alone, and you are only changing the one associated with the ad. We don’t want to go about fixing the ads while ruining other parts of your website in the process.

To get rid of that adsense yellow box background you need to add a small bit of CSS code into your theme’s CSS file. To do this in WordPress, head into the admin panel and go to ‘Appearance -> Editor’ and then add the following code to the CSS file (stylesheet) of your theme. For other Content Management Systems, you will need to find and edit your CSS file.

ins.adsbygoogle {
 background: transparent;
 text-decoration: none;
}