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.
- SSH onto your Smoothwall device — see https://help.smoothwall.net/Latest/Content/ui/admin/remote.htm
- Execute the following command:
echo 1 > /modules/guardian3/settings/ui/blocklist/advanced
- Next we must create a new category which will contain all Google domains:
- Go to Guardian > Policy Objects > Categories.
- Enter a name (for example, Google)
- Expand the Advanced section
- Enter the following under URL patterns:
google\.\w{1,3}(?:\.\w{1,3})?
- 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:
- Go to Guardian > Content modification > Content modifications.
- Enter a name (for example, Remove Google Ads)
- Expand the Advanced section.
- 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>"
- Finally, we need to create a content modification policy to apply our new content modification (Remove Google Ads) to our new category (Google):
- Go to Guardian > Content modification > Policy Wizard.
- 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 |
|