Do you want to disallow some IP to see adsense ads in your website? For instance do you want your adsense ads not to be shown in your own computer (IP) or IP address of spammers?
You can do this by simply using a PHP code. Continue reading to find more.
So the basic idea is to ban or disallow some IP address from shopping adsense ads in your website.
So after you implement the idea or code given below the IP address you list in the code will not be able to see adsense ads in your website.
This Idea is very useful if you want to block spammers and bots or your own computer from displaying adsense ads in your website.
Basically this code will first check the IP address of the client computer and if the IP matches any of the IP listed in the code then the adsense ads will not be shown in the computer or browser else the client will be able to see the adsense ads.
So here is the code for the job:
<?php
$visitorIP = $_SERVER['REMOTE_ADDR'];
$blockedips = array('123.45.67.89', '123.45.67.89');
if (!in_array($visitorIP,$blockedips)) {
?>
Write your adsense code here.
<?php
}
?>
So all you have to do is replace the IPs listed in the code as 123.45.67.89 with the IP you want to block if you want to block more or less than two IPs then you can add or delete IP in the same format separated by comma , and replace “Write your adsense code here” with your adsense code.
You are done now!
So now the IP listed in the array will not see ads in your website when they will open your website.
Popular Searches:
- how to block adsense ads in particular ip
- adsense ip address
- prevent adsense from displayed on certain IP
- How to stop Infolinks
- adsense ip
- $blockedips = array(
- block adsense code using ips
- block adsense ip
- not showing ads on specific ip
- block ip adsense ads wordpress
- How to Prevent Displaying Adsense Ads wordpress
- how to stop particular ip
- how to stop displaying on specific ad
- ip address internet adsense
- how to stop website ads
- how to stop jobsite ads
- how to stop the ads from playing in website
- how to stop specific ads when on the web
- how to stop showing IP
- how to stop commercials from playing in the background of websites?
- how to stop certain websites from displaying
- how to disallow IP ping
- how to i stop advertising from playing on certain websites
- How to stop ads from global ard yahoo website?
- how to stop ads from playing in the background
- how to stop ads showing on your web pages
- how to stop adsense
- how to stop adsense ads
- how to stop adsense ads from showing to ip ranges
- how to stop adsense for your browser?

3 Comments
Are not working for blogger blog.. please solve it.
@Rajib Kumar
For the code to work you need to have PHP enabled on your host and I don’t think blogspot allows to host PHP code.
Where will I paste the PHP code? Thanks.