Removing Adverts from Google

Article #:

Product

Castle

KB-77

All

All

Warning: This article requires enabling advanced functionality and should only be attempted by experienced users

Summary

This article describes what steps you must take in order to hide Adverts from appearing in the Google search engine.

Problem

Clicking on advert links from Google search results loads a blank page with the phrase "Advert blocked" on the top left-hand side. Instead, you would like to prevent your users from being able to click on or even view these adverts.

Solution

In order to remove advert links from Google searches, you will first need to enable the hidden Advanced functionality of your Smoothwall device.

  1. SSH onto your Smoothwall device — see https://help.smoothwall.net/Latest/Content/ui/admin/remote.htm
  2. Execute the following command:

echo 1 > /modules/guardian3/settings/ui/blocklist/advanced

  1. Next we must create a new category which will contain all Google domains:
    1. Go to Guardian > Policy Objects > Categories.
    2. Enter a name (for example, Google)
    3. Expand the Advanced section
    4. Enter the following under URL patterns:

google\.\w{1,3}(?:\.\w{1,3})?

  1. Now we must create a new content modification which will inject some CSS into the head of the page which will be responsible for hiding the adverts on Google:
    1. Go to Guardian > Content modification > Content modifications.
    2. Enter a name (for example, Remove Google Ads)
    3. Expand the Advanced section.
    4. Enter the following under Page modifications (be sure to include the quote marks):

"(<head>)"->"$1<style>.ads-ad, .commercial-unit-desktop-top, .commercial-unit-desktop-rhs, .commercial-unit-mobile-top { display: none !important; }</style>"

  1. Finally, we need to create a content modification policy to apply our new content modification (Remove Google Ads) to our new category (Google):
    1. Go to Guardian > Content modification > Policy Wizard.
    2. Create your new policy as follows:
    Who: Everyone *
    What: Google
    Where: Everywhere *
    Action: Apply Remove Google Ads
    * Change as appropriate

Once you’ve finished it will take a few minutes for the changes to take effect — you may need to restart your browser in order to see the changes.

Before

After

Attribution:

Last updated:

Author:

Contributions by:

09 February 2017

Christopher Smith

 

 

 

Copyright © 2000-2016 Smoothwall All rights reserved.