4 Ways To Avoid Ban by Google for Testing Site Template with Adsense Code on Localhost

Lot many webmasters and designers worry about testing a test or offline site with Google Adsense code on localhost. They do test the design changes for many times on localhost which turns into lot many impressions of Adsense ads on the offline or “under construction” site. As per the TOS of adsense testing site Google Adsense, you should not use Adsense code on “Under Construction sites. Adsense Codes should be there on live sites only. In case you accidently click on those served ads while testing the site, it may lead to get Adsense account banned from Google. If you are testing your site locally using WAMP, XAMP, LAMP or any other platform, you should avoid using the Adsense impressions or even code in the template. To avoid the Adsense account ban for these issues, you can try below ways to complete your template, design changes testing.

Use Screenshots of Adsense Ads from Live Site

Best way of testing a site design changes with Adsense layout is to put the screenshot of Adsense ads on the same place where Adsense code is located on live site. If you are planning to add new “Adsense Size” ad then go to any website which is using that layout or your can take screenshot from Adsense Sandbox. This way you can avoid any impression of Adsense ads on test site while testing it.

Install AdBlock Chrome Extension or Firefox Add-on

You should not click on ads running on your own site whether it is a live site or test site. To avoid any hit on localhost sites, you should install “AdBlockChrome Extension or Mozilla Firefox add-on. AdBlock blocks advertisements from Google or other network to appear on the browser. So this will also help you ion avoiding any accidental hit on Adsense ads.

Test Template Without Adsense Code

Basic way to avoid any penalty is to remove the complete code of adsense from the site. You can keep the DIV section of the adsense ad area on HTML part. Test your site changes and add Adsense code at the time of upload.

Use “Ozh’ Who Sees Ads” plugin on WordPress Sites

If your test site is on self hosted WordPress platform, then you can use “Ozh’ Who Sees Ads” plugin to control the visibility of Adsense or other ads. Thru this WordPress plugin, you can set the option to avoid any impression of adsense ad on site template to appear while testing. This plugin is having lot many ad visibility option for live sites as well but you can customize it for avoiding any ban from Google for Adsense TOS violation.

Also Read: How To Increase Income Thru Adsense By Doing Simple Changes

Back in 2009, people were used to use google_adtest = "on" for the test sites but now this features is no longer available. As per the TOS of Adsense, Publishers are not allowed to make any changes in the Adsense Code. So don’t use google_test = “on” while testing your site. To avoid penalty or ban from Google for wrong implementation of adsense, use any of above 4 ways while testing your site on localhost. 

Related: Google Adsense Payment Schedule and Check Arrival Time in India

Sanjeev Mishra is a professional blogger and an Internet Marketing Consultant based in India. He has built the Internet Techies to provide you updates in technology and web application area.
  • Great Information! In addition to above, another way to accomplish this is by changing your Google Adsense Account settings.

    Login to your Adsense account. Go to Account Settings – > Access and Authorization and under ‘Sites authorized to show ads’ option, specify a list of domain names of the sites that should be authorized to show your content i.e. your domain and your partner domains in any.

    In this way any impressions on localhost will not be counted under your account.

  • I didn’t know you can be banned for testing on localhost. Oops! Thanks for the heads up and tips.

  • Heay Sanjeev.
    Thanks for posting this……..i was frightened about my own impression during changing anything on my templates and adsense codes. Finally i got a solution that is “Ozh’ Who Sees Ads” and to me, it’s the best for protecting ownself from getting banned by Google.

    Let me ask you another question – “How have you managed your blogging? ” I have seen that, you are very consistent on blogging and doing well too

    I am also a technology blogger like you…..but can’t get any idea what to write everyday. How you brainstorms daily?

    Thanks……nice to meet you here.

  • Hi , I believe there is also an account number that allows you to send the money to charity I believe it is 123456…. and if you put that on your site it sends all the money adsense generates to charity,which is great for testing the site especially with dreamweaver (does anyone still use that!) But remember to change it back to yours afterwards!

  • Can also use “preview ads” feature to view the as within your adsense account. the feature has, infact been provided for the same purpose and it one of the read {only} solutions given by the adsense team on their official blog.

  • i dont get what u mean by changing an account number!! we are allowed to change the payment details only once, and the info is still devoid of any account number since they deliver it in the form of check!