SEMrush

How to remove the unwanted background from adsense ads

remove the unwanted background from adsense ads

Are you seeing unwanted background in your adsense ads in your wordpress site? Do you want to remove the unwanted background from adsense ads? You are not alone. And I recently found a solution when having the same problem.

When I first added adsense ads on this blog, I saw that there were unwanted brown background behind the adsense ads. They were really ugly and were making my blog ugly too. I had to remove the unwanted background from adsense ads. So I started looking around and finally found the culprit.

It’s likely because of the default wordpress themes like twenty sixteen and previous themes.

Google uses a css class called ‘ins’ to style their ads. The default wordpress themes like twenty sixteen, twenty fifteen and others have pre defined the style for this class in the style.css .

This is how it looks like in the style.css file

ins {
 background: #007acc;  //This is the problematic style
 color: #fff;
 padding: 0.125em 0.25em;
 text-decoration: none;
}

The theme developers have done a terrible job in styling this. So you need to modify the style to remove the unwanted background from adsense ads.

Don’t worry. It’s a very simple process.

  1. Login to your wordpress dashboard and go to appearance -> editor.
  2. Now look for the style.css file in the right side and open it to edit it.
  3. In the style.css file, look for ‘.ins’ class which will look like the snippet shown above. When you find it, change ‘ background: #007acc; ‘ to ‘ background: none !important ‘. The new code should look like the code below :
    ins {
     background: none !important; //This code has been changed
     color: #fff;
     padding: 0.125em 0.25em;
     text-decoration: none;
    }

    Or you can simply copy paste the above code to replace the old one.

Now your adsense ads will not have any unwanted background.

You may also want to check out how to create a compelling homepage.

Follow me on twitter or like my facebook page.

Would love to see your comments in the discussion box below.