How To Add Margin and Label Around Google Adsense Auto Ads

Google Adsense Auto ads by default tends to place ads in random sections of your website and most times the ads do not align properly with the content and there’s no visible way to adjust the space or margins around the ads as they are automatically inserted by Google.

If you know your way around editing the style.css or style.min.css file of your wordpress theme, go ahead and try this trick.

Simply go to your theme’s stylesheet and add this

.google-auto-placed{margin-top:2em;margin-bottom:2em;}

Save and clear cache if you use a cache plugin. Reload your pages and your ads will automatically have spaces at the top and at the bottom seperating them from your content.

If you wish to distinguish google adsense ads from your normal content so as to avoid accidental or invalid clicks, add the code below to your stylesheet too.

.google-auto-placed:before{content:”Advertisement”;font-size:10px;}

This automatically adds the label Advertisement above every ad that google adsense auto ads injects into your web page. You can adjust the size of the font or the wordings of the label if you so wish.

Below is what the final result will look like on your pages. Well spaced ads

Label and Space Out Google Adsense Auto Ads

Do let me know in the comment section, if you found this helpful and if you did, don’t forget to share too. Take care.

Please Rate This Post:
4.8/5 - (61 votes)

You’ll also like:

  1. How To Fix CLS - Core Web Vitals Issues Caused By Google Adsense
  2. Adsense For Mobile Content Wordpress Setup Guide
  3. AdMob To Stop Serving Mobile Web Publisher Ads In October 2011
  4. How To Show Alternate Ads - Content To Opera Mini Visitors
  5. How To Add Google Adsense - Analytics To Wordpress AMP Pages

Please share this article to help others. Thanks