{"id":60344,"date":"2022-03-21T15:01:59","date_gmt":"2022-03-21T09:31:59","guid":{"rendered":"https:\/\/www.quickonlinetips.com\/archives\/?p=60344"},"modified":"2026-10-06T15:33:54","modified_gmt":"2026-10-06T10:03:54","slug":"hide-unfilled-adsense-ad-spaces","status":"publish","type":"post","link":"https:\/\/www.quickonlinetips.com\/archives\/2022\/03\/hide-unfilled-adsense-ad-spaces\/","title":{"rendered":"How to Hide Unfilled AdSense Ad Spaces (Official CSS Method, 2026)"},"content":{"rendered":"<p>Blank AdSense boxes make a site look broken. When Google has no ad to show, an AdSense unit can leave an empty space on your page. The good news: Google officially lets you <strong>hide unfilled AdSense ad spaces<\/strong> with one line of CSS, without breaking AdSense rules, or show your own backup ad instead. Here&#8217;s how it works in 2026.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-large wp-image-60348\" src=\"https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/blank-ad-spaces-1024x682.jpg\" alt=\"Hide unfilled AdSense ad spaces\" width=\"760\" height=\"506\" srcset=\"https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/blank-ad-spaces-1024x682.jpg 1024w, https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/blank-ad-spaces-300x200.jpg 300w, https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/blank-ad-spaces-150x100.jpg 150w, https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/blank-ad-spaces-768x512.jpg 768w, https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/blank-ad-spaces.jpg 1280w\" sizes=\"(max-width: 760px) 100vw, 760px\" \/><\/p>\n<p><strong>Quick answer:<\/strong> Add this CSS to your site: <code>ins.adsbygoogle[data-ad-status=\"unfilled\"] { display: none !important; }<\/code>. AdSense marks each ad unit as filled or unfilled, and this rule hides only the empty ones. It&#8217;s the method Google itself documents, so it&#8217;s allowed.<\/p>\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_89 counter-hierarchy ez-toc-counter ez-toc-custom ez-toc-container-direction\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<label for=\"ez-toc-cssicon-toggle-item-6ae6f9ba88a32\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"ez-toc-cssicon\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #1a202c;color:#1a202c\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #1a202c;color:#1a202c\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-6ae6f9ba88a32\" checked aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2022\/03\/hide-unfilled-adsense-ad-spaces\/#Why_do_AdSense_ad_spaces_stay_empty\" >Why do AdSense ad spaces stay empty?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2022\/03\/hide-unfilled-adsense-ad-spaces\/#Does_AdSense_collapse_empty_ads_automatically\" >Does AdSense collapse empty ads automatically?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2022\/03\/hide-unfilled-adsense-ad-spaces\/#How_to_hide_unfilled_AdSense_ad_spaces_with_CSS\" >How to hide unfilled AdSense ad spaces with CSS<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2022\/03\/hide-unfilled-adsense-ad-spaces\/#Show_your_own_backup_ad_instead\" >Show your own backup ad instead<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2022\/03\/hide-unfilled-adsense-ad-spaces\/#What_about_Auto_ads\" >What about Auto ads?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2022\/03\/hide-unfilled-adsense-ad-spaces\/#Frequently_asked_questions\" >Frequently asked questions<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2022\/03\/hide-unfilled-adsense-ad-spaces\/#Is_it_allowed_to_hide_unfilled_AdSense_ads\" >Is it allowed to hide unfilled AdSense ads?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2022\/03\/hide-unfilled-adsense-ad-spaces\/#Will_hiding_empty_ads_reduce_my_earnings\" >Will hiding empty ads reduce my earnings?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2022\/03\/hide-unfilled-adsense-ad-spaces\/#Why_are_my_AdSense_ads_blank_on_some_pages_only\" >Why are my AdSense ads blank on some pages only?<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n<h2><span class=\"ez-toc-section\" id=\"Why_do_AdSense_ad_spaces_stay_empty\"><\/span>Why do AdSense ad spaces stay empty?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>AdSense leaves a unit unfilled when it has no suitable ad for that page, visitor or moment. Common reasons:<\/p>\n<ul>\n<li><strong>Thin or unclear content:<\/strong> AdSense can&#8217;t work out what the page is about, so few advertisers match it.<\/li>\n<li><strong>Low advertiser demand<\/strong> for your topic, country or time of year.<\/li>\n<li><strong>Policy restrictions<\/strong> on the page, such as sensitive or borderline content that only limited ads can appear on.<\/li>\n<li><strong>Too many ad units<\/strong> on one page.<\/li>\n<li><strong>A new site<\/strong> that AdSense is still learning about.<\/li>\n<\/ul>\n<p>In the early days, AdSense filled these gaps with <a href=\"https:\/\/www.quickonlinetips.com\/archives\/2005\/02\/public-service-ads-psa-in-adsense-how-to-get-rid-of-them\/\">public service ads<\/a>. Today it either collapses the unit or leaves a blank space. The long-term fix is better content: clear, detailed pages on a focused topic attract more relevant ads and more search traffic.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Does_AdSense_collapse_empty_ads_automatically\"><\/span>Does AdSense collapse empty ads automatically?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Partly. <a href=\"https:\/\/support.google.com\/adsense\/answer\/10762946?hl=en\" target=\"_blank\" rel=\"noopener\">Google says<\/a> AdSense tries to collapse unfilled units, but only when it won&#8217;t make the page jump around (called layout shift). Units already visible on the screen when the page loads usually stay as blank spaces. That&#8217;s where the CSS fix helps.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"How_to_hide_unfilled_AdSense_ad_spaces_with_CSS\"><\/span>How to hide unfilled AdSense ad spaces with CSS<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>AdSense adds a <code>data-ad-status<\/code> attribute to every ad unit on your page:<\/p>\n<ul>\n<li><code>data-ad-status=\"filled\"<\/code>: an ad is showing.<\/li>\n<li><code>data-ad-status=\"unfilled\"<\/code>: no ad was returned, so the space is empty.<\/li>\n<li><code>data-ad-status=\"unfill-optimized\"<\/code>: no ad was returned, but AdSense&#8217;s &#8220;Fill empty in-page ads&#8221; setting has handled it.<\/li>\n<\/ul>\n<p>To hide the empty units, add this to the <code>&lt;head&gt;<\/code> of your site:<\/p>\n<pre><code>&lt;style&gt;\r\nins.adsbygoogle[data-ad-status=\"unfilled\"] {\r\n  display: none !important;\r\n}\r\n&lt;\/style&gt;<\/code><\/pre>\n<p>If you&#8217;re adding it to an existing stylesheet, or in WordPress under <strong>Appearance \u2192 Customize \u2192 Additional CSS<\/strong>, leave out the <code>&lt;style&gt;<\/code> tags:<\/p>\n<pre><code>ins.adsbygoogle[data-ad-status=\"unfilled\"] {\r\n  display: none !important;\r\n}<\/code><\/pre>\n<p><strong>Note:<\/strong> if you&#8217;ve turned on <strong>Fill empty in-page ads<\/strong> in your AdSense account, empty units get the <code>unfill-optimized<\/code> status instead, so this CSS won&#8217;t hide them. In that case AdSense manages those spaces itself.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Show_your_own_backup_ad_instead\"><\/span>Show your own backup ad instead<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Rather than hiding the space, you can fill it with your own &#8220;house ad&#8221;, for example a link to a popular post, your newsletter or your shop. Google documents this method as allowed.<\/p>\n<p>First, add CSS that hides your backup link by default and shows it only when the unit is unfilled:<\/p>\n<pre><code>ins.adsbygoogle a {\r\n  display: none !important;\r\n}\r\nins.adsbygoogle[data-ad-status=\"unfilled\"] a {\r\n  display: block;\r\n}<\/code><\/pre>\n<p>Then place your backup image link inside the ad code, just before the closing <code>&lt;\/ins&gt;<\/code> tag, at the same size as the ad unit:<\/p>\n<pre><code>... rest of AdSense code ...\r\n&lt;a href=\"\/your-page\/\"&gt;&lt;img src=\"\/backup-ad.jpg\" width=\"300\" height=\"250\" alt=\"\" \/&gt;&lt;\/a&gt;\r\n&lt;\/ins&gt;<\/code><\/pre>\n<p>Only make the change Google describes. Other <a href=\"https:\/\/www.quickonlinetips.com\/archives\/2013\/05\/modify-adsense-code-for-responsive-design\/\">modifications to AdSense code<\/a> can break the rules and put your account at risk.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"What_about_Auto_ads\"><\/span>What about Auto ads?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>If you use <a href=\"https:\/\/www.quickonlinetips.com\/archives\/2022\/12\/using-adsense-auto-ads\/\">AdSense Auto ads<\/a>, Google decides where ads go and only inserts them when it has one to show, so you won&#8217;t usually see empty Auto ad spaces. The CSS fix is mainly for manual ad units you&#8217;ve placed yourself.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Frequently_asked_questions\"><\/span>Frequently asked questions<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3><span class=\"ez-toc-section\" id=\"Is_it_allowed_to_hide_unfilled_AdSense_ads\"><\/span>Is it allowed to hide unfilled AdSense ads?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Yes. <a href=\"https:\/\/support.google.com\/adsense\/answer\/10762946?hl=en\" target=\"_blank\" rel=\"noopener\">Google&#8217;s AdSense Help<\/a> explains this exact CSS method, so using it doesn&#8217;t break the program policies.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Will_hiding_empty_ads_reduce_my_earnings\"><\/span>Will hiding empty ads reduce my earnings?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>No. Unfilled units earn nothing anyway. Hiding them just improves your page design. A backup ad can even bring extra value from the same space.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Why_are_my_AdSense_ads_blank_on_some_pages_only\"><\/span>Why are my AdSense ads blank on some pages only?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Usually because of the page&#8217;s content. Thin pages, unclear topics or pages with limited-ads content get fewer matching ads. Improving the content often helps.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Blank AdSense boxes make a site look broken. When Google has no ad to show, an AdSense unit can leave&#8230;<\/p>\n","protected":false},"author":4,"featured_media":60348,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_kad_post_transparent":"default","_kad_post_title":"default","_kad_post_layout":"default","_kad_post_sidebar_id":"","_kad_post_content_style":"default","_kad_post_vertical_padding":"default","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"_kad_post_classname":"","footnotes":""},"categories":[43],"tags":[13,49],"class_list":["post-60344","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-advertising","tag-adsense","tag-tutorials"],"_links":{"self":[{"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/posts\/60344","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/comments?post=60344"}],"version-history":[{"count":1,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/posts\/60344\/revisions"}],"predecessor-version":[{"id":63245,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/posts\/60344\/revisions\/63245"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/media\/60348"}],"wp:attachment":[{"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/media?parent=60344"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/categories?post=60344"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/tags?post=60344"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}