Jump to content

Disable GoogleAds - Server-Side

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
10 replies to this topic

#1
averre

averre

    Newbie

  • Members
  • Pip
  • 6 posts
Hi!

I am trying to disable that annoying GoogleAds from my web page. But from the beginning I failed. I have tried blocking div, blocking java, blocking google ips in htaccess and nothing happens. Ads still are in.

And now I am asking you to help me disable that ads using html, javascript, java-applet, flash or simply php, because GoogleAds are the most uncomfortable ads for my site I have ever seen before.

That is my site (only for now it is absolutely simple) with that ads added to every of my page by my hosting:

sts.c0.pl

If you find a method I will be your slave :).

#2
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
Without going to your site: is this a free hosted site? If so, it will be a violation of the terms of service to remove them. If not, why are you sending the code in your source to begin with?
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

#3
Guest_Jordan_*

Guest_Jordan_*
  • Guests
You should consider paying for a hosting service or going with a free host that doesn't enforce ads.

#4
averre

averre

    Newbie

  • Members
  • Pip
  • 6 posts
I need to use that hosting (it is free). I need to disable that ads. The only person who could help me disappear. He only said that he disabled that ads on his page using JS and DOM, but I do not know how. If you know how to disable that kind of unpolite ads please tell me. If any of you do not know how to do it, Google wins and I left that hosting.

But I saw that with one kind of script (while that script installation) there are not GoogleAds displayed. So I think it is possible.

Oh, I just saw that. In terms of this hosting is wrtitten:

'we add ads to every hosted site'

And nothing more. They allow ads removing, if someone can.

So if you know how, please again, tell me.

#5
amrosama

amrosama

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 8,674 posts
easy , i did that on my website just now(ofcourse its pointless , but i like slaves)
all you need to know is the container (div,span,...) that the ads are in, then set the innerHTML to "" (nothing)
without links or code i cant help any further
yo homie i heard you like one-line codes so i put a one line code that evals a decrypted one line code that prints "i love one line codes"
eval(base64_decode("cHJpbnQgJ2kgbG92ZSBvbmUtbGluZSBjb2Rlcyc7"));
www.amrosama.com | the unholy methods of javascript

#6
BlaineSch

BlaineSch

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 2,448 posts
Just disable the script tag or something.

#7
averre

averre

    Newbie

  • Members
  • Pip
  • 6 posts
Ok, I delete that ads, but... I delete also every single div on the site, so I can't use css at all. So, in my case I use that code in head section:

<style>

div {display:none;}

</style>

How can you see I am completely stuck, because most of the scripts are using css. My problem is how to hide divs with random generated ids. Can you help me in that case. But I'm not very well with programming so it will be useful when you write me all of the code :).

I just do not know which sign in <style> tag is that star-sign which you can use in for example pma to select all the records or tables :).

I want to block only a div which have 28 signs. Not that divs which have 27 or 29, but only that one which have 28 signs and which is random generated with page reloading.

#8
amrosama

amrosama

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 8,674 posts
heres your solution:

document.getElementsByTagName("div")[0].innerHTML="";

keep changing the 0 till you find the right div
yo homie i heard you like one-line codes so i put a one line code that evals a decrypted one line code that prints "i love one line codes"
eval(base64_decode("cHJpbnQgJ2kgbG92ZSBvbmUtbGluZSBjb2Rlcyc7"));
www.amrosama.com | the unholy methods of javascript

#9
averre

averre

    Newbie

  • Members
  • Pip
  • 6 posts
I change my mind, it is better for me to block div by it's size (i mean width and height), is that possible?

And I have a question. Is that code:

document.getElementsByTagName("div")[0].innerHTML="";

Should be before </head> and in tags <script> and </script>?

What '0' means in that code? That is number of letters in div's id?

Sorry for my stupidity, but I am not an Einstein or some other intelligent guy :).

EDIT

In that GoogleAd div looks like this:

dif=document.createElement('div');with(dif.style){textAlign='center';height='110px'}dif.innerHTML='<iframe align="center" src="'+src+'" scrolling="no" frameborder="0" style="display: block !important; position: absolute; left: 50% !important; top:13px !important; z-index:10000 !important; margin-left: -364px !important; height:90px !important;width:728px !important;border:0px !important"></' + 'iframe>';

Am I right that if I block every div which width is 728px and height is 90 px that ads won't show?

#10
amrosama

amrosama

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 8,674 posts
lol, its okay. i forgot to explain
this code

document.getElementsByTagName("div")[0].innerHTML="";
should be at the end of the page, it gets all DIVs in your page and sets DIV no.[0] innerHTML to nothing which empties it
so keep changing the 0 and refresh till the google ads disappears
yo homie i heard you like one-line codes so i put a one line code that evals a decrypted one line code that prints "i love one line codes"
eval(base64_decode("cHJpbnQgJ2kgbG92ZSBvbmUtbGluZSBjb2Rlcyc7"));
www.amrosama.com | the unholy methods of javascript

#11
averre

averre

    Newbie

  • Members
  • Pip
  • 6 posts
That Google was problably in a few divs. Finally I win the battle with that in body tag:

<script>window.onload = function() { document.body.removeChild(document.body.firstChild); }</script>


It disabling ads after page loaded so ads are visible for moment :).