Our Low Overhead Means Lower Costs For You!


How to limit the size of Google AdSense Ads on your site

Read Time: 2 mins

Having your site produce some passive income by displaying a few ads is a good option for many WordPress sites.

However, whether or not you enable Google AutoAds, by default some of the ads that are displayed are humongous and disrupt the flow of your posts or pages.

First, you can instruct Google not to place ads on certain pages. This is a setting on the AdSense site.

For even finer control, I use the Ad-Inserter WordPress plugin where you can specify not only location but Posts only or Pages only and several other options. This also allows you to display different ads in different places on your site.

However, there is still an issue with some of the AdSense ads being unacceptably large. To fix this, you need to make a small customization to the AdSense code. I found this by digging down few levels on the Google AdSense Support site to this page and then scrolling down to the section titled “Specify an expandable width and a fixed height”, so it’s safe to use and does not violate any of Google’s policies.

The standard code Google tells you to use will look something like this:

ins class=".....">....
style="display:block"

To limit the size of displayed ads, you need to change that part of the code to this

ins class=".....".....
style="display:inline-block;min-width:400px;max-width:970px;width:100%;height:90px;"

That’s it! You can play with the min-width and max-width settings a bit to make it better for your site and location.

Note: On some sites, if the ads stop displaying, check your AdSense account. You may see some errors/notices saying “Restricted Demand”. That means there aren’t enough ads in stock for your site or niche at the 90px height. If so, try increasing the height to 150 or 200px and see if the ads come back. You may need to experiment a bit. The idea is to keep ads displaying and maximize your income without allowing the ads to grow too large for the page.

Social Sharing

Leave a comment

Your email address will not be published.


*


This site uses Akismet to reduce spam. Learn how your comment data is processed.