How to prevent Google from serving on pages with violations to protect your earnings

How to prevent Google from serving on pages with violations to protect your earnings

Google can disable ad serving on your site at any time if you continue to violate program policies. The worst-case scenario is getting your entire account banned. Often, only a specific section or page is in violation, so you don’t have to shut Google demand completely but only prevent it from serving where violations exist.

The steps below apply to WordPress users only but might also provide some useful bits of information if you are using a different CMS.


Step 1: List all the URLs of the pages with violations in a notepad, 1 per line. Exclude the root domain and add *.

For example, if this is the page, you only list it as /sunflawer-shaders-1-14-4/*

site example

Sample on a notepad for 2 URLs:


Step 2: Create a header Hook on Wordpress using Ad Inserter plugin

  • If not done yet, install Ad Inserter plugin and activate it
  • Go to Settings > Ad Inserter
  • Click on General Settings (gear icon)
  • Go to the Hooks tab
  • Create a hook with action: wp_head and make sure it’s checked
  • Save Settings

ad inserter settings

Step 3: On Google Ad Manager, create a key-value pair (KVP):

  • key name: google
  • value: no


Step 1: Deploy the header tag that contains the KVP in one of the blocks

kvp code

Step 2: Select all sections

select sections

Step 3: Select the header hook you created for the Insertion

header source code

Step 4: Click on Lists > click URLs > paste the list of URLs with violations 1 per line (see below screenshot)

Step 5: Select White list > Save settings

select settings

Step 6: Open the block which contains the regular header tag/s that targets the URLs where you don’t want Google to run

Step 7: Click Lists > paste the list of URLs where you don’t want Google to run > set to Black list

code section

Repeat steps 4 to 7 for URLs you’d like to add in the future.

Step 8: Save

Google line items in Google Ad Manager

The action below will make your Google line items ineligible to serve where the key-value pair exists.

Step 1: In Google Ad Manager, open each of your AdSense/Google Ad Exchange line items

Step 2: Set Custom Targeting to Google > is none of > no

custom targeting

Step 3: Save


Now you know how to add an extra layer of protection and prevent your account from getting banned. Violating Google program policies is never a good idea. Be sure to follow them as closely as possible.

Are you still struggling with policy violations or invalid traffic and don’t know how to rid yourself of these issues? Let MonetizeMore help! Our ad optimization specialists know Google program policies inside and out and can help you with invalid traffic concerns. Sign up to MonetizeMore today!

Kean Graham

CEO and Founder at MonetizeMore

Kean has been a pioneer in the AdTech world since 2010 who believes in the supremacy of direct publisher deals, programmatic advertising, and building ad technology as keys to scaling ad revenue. Here, he provides publisher resources and guides covering areas like website monetization, AdSense optimization, Google Ad Manager, Ad Exchanges, and much more.

Get our latest ad optimization tips delivered to your inbox

Fill out my online form.

1 Comment

  1. ethereumregulation

    Thanks for sharing the pieces of information. Would love to learn more from those who have more experience in website blogging.


Submit a Comment

Your email address will not be published.