htmlcssadsense

Disable Google Search button displayed on the page automatically by Adsense


I have Google Adsense enabled on my web site. On some pages a Search button like the following is displayed at a random location on the page:

Search Button

This button is also staying over page contents when I try to print the page and obscures a part of the content.

I want to disable it during print. I tried to hide it using the following CSS (for media="print"):

[class^="autoprose"],
[class^="auto-prose"]
{
  display: none !important;
}

It seems to work. However, I am searching for a better solution.

We should blame also Google for forgetting to remove this button on printed web pages.

The code automatically inserted by Google is something like this:

<button class="autoprose-search-button">
 <div class="autoprose-search-icon">
  <svg width="18" height="18" viewBox="0 0 18 18">
   <path fill-rule="evenodd" clip-rule="evenodd" d="M11.76 10.27L17.49 16L16 17.49L10.27 11.76C9.2 12.53 7.91 13 6.5 13C2.91 13 0 10.09 0 6.5C0 2.91 2.91 0 6.5 0C10.09 0 13 2.91 13 6.5C13 7.91 12.53 9.2 11.76 10.27ZM6.5 2C4.01 2 2 4.01 2 6.5C2 8.99 4.01 11 6.5 11C8.99 11 11 8.99 11 6.5C11 4.01 8.99 2 6.5 2Z" fill="white">
   </path>
  </svg>
 </div>
 <div class="autoprose-search-text">Search</div>
</button>

Note that, this Search button is not created by any web browser extension (disabling all web browser extensions does not change anything) and it is the same for Firefox, Chrome, and Edge browser. On the other hand, when I remove all Adsense code from my page, the Search button is no longer displayed.


Solution

  • AdSense Lab: Search for Auto ads

    Search for Auto ads is an easy-to-deploy search box that will be added to your site. With this tool, users are given access to a Google-powered search experience that shows site search results and AdSense for Search ads.

    https://support.google.com/adsense/answer/12490210