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
- adsense ip
- prevent adsense from displayed on certain IP
- How to stop Infolinks
- block adsense code using ips
- block adsense ip
- not showing ads on specific ip
- block ip adsense ads wordpress
- $blockedips = array(
- How to Prevent Displaying Adsense Ads wordpress
- disallow ip
- how to stop website ads
- how to stop certain websites from displaying
- how to stop commercials from playing in the background of websites?
- how to stop dispay adsense on own computer
- how to stop displaying IP on web
- how to stop the ads from playing in website
- how to stop displaying on specific ad
- how to stop specific ads when on the web
- how to stop showing IP
- how to stop particular ip
- how to stop infolinks from opening
- is adsense working on ip
- how to stop jobsite ads
- how to stop ban adsense
- how to block specific ip in adsense
- how to disable certain ip in adsense
- how to disallow IP ping
- how to stop a website from showing on a certain computer

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.