【问题标题】:How to remove unwanted ad sense ads from Home Page?如何从主页中删除不需要的广告感觉广告?
【发布时间】:2015-10-24 09:11:30
【问题描述】:

我的一些观众报告说在我的主页顶部 wwww.shifter.pt 上看到了(不需要的)广告

我已经更改了 FTP 访问密码、数据库密码和网站所有用户的密码。重新启动服务器,没有任何改变。

广告中的代码如下所示,位于标题之前:

<center><script async="" src="//www.google-analytics.com/analytics.js"></script><script async="" type="text/javascript" src="http://www.gstatic.com/pub-config/ca-pub-7837806915816060.js"></script><script async="" src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- de -->
<ins class="adsbygoogle" style="display:inline-block;width:728px;height:90px" data-ad-client="ca-pub-7837806915816060" data-ad-slot="1724932034" data-adsbygoogle-status="done"><ins id="aswift_0_expand" style="display:inline-table;border:none;height:90px;margin:0;padding:0;position:relative;visibility:visible;width:728px;background-color:transparent"><ins id="aswift_0_anchor" style="display:block;border:none;height:90px;margin:0;padding:0;position:relative;visibility:visible;width:728px;background-color:transparent"><iframe width="728" height="90" frameborder="0" marginwidth="0" marginheight="0" vspace="0" hspace="0" allowtransparency="true" scrolling="no" allowfullscreen="true" onload="var i=this.id,s=window.google_iframe_oncopy,H=s&amp;&amp;s.handlers,h=H&amp;&amp;H[i],w=this.contentWindow,d;try{d=w.document}catch(e){}if(h&amp;&amp;d&amp;&amp;(!d.body||!d.body.firstChild)){if(h.call){setTimeout(h,0)}else if(h.match){try{h=s.upd(h,i)}catch(e){}w.location.replace(h)}}" id="aswift_0" name="aswift_0" style="left:0;position:absolute;top:0;"></iframe></ins></ins></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
<br>
<script async="" src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- uk -->
<ins class="adsbygoogle" style="display:inline-block;width:336px;height:280px" data-ad-client="ca-pub-7837806915816060" data-ad-slot="8650939636" data-adsbygoogle-status="done"><ins id="aswift_1_expand" style="display:inline-table;border:none;height:280px;margin:0;padding:0;position:relative;visibility:visible;width:336px;background-color:transparent"><ins id="aswift_1_anchor" style="display:block;border:none;height:280px;margin:0;padding:0;position:relative;visibility:visible;width:336px;background-color:transparent"><iframe width="336" height="280" frameborder="0" marginwidth="0" marginheight="0" vspace="0" hspace="0" allowtransparency="true" scrolling="no" allowfullscreen="true" onload="var i=this.id,s=window.google_iframe_oncopy,H=s&amp;&amp;s.handlers,h=H&amp;&amp;H[i],w=this.contentWindow,d;try{d=w.document}catch(e){}if(h&amp;&amp;d&amp;&amp;(!d.body||!d.body.firstChild)){if(h.call){setTimeout(h,0)}else if(h.match){try{h=s.upd(h,i)}catch(e){}w.location.replace(h)}}" id="aswift_1" name="aswift_1" style="left:0;position:absolute;top:0;"></iframe></ins></ins></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script> 
<br>
<script async="" src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- US -->
<ins class="adsbygoogle" style="display:inline-block;width:320px;height:100px" data-ad-client="ca-pub-7837806915816060" data-ad-slot="1127672839" data-adsbygoogle-status="done"><ins id="aswift_2_expand" style="display:inline-table;border:none;height:100px;margin:0;padding:0;position:relative;visibility:visible;width:320px;background-color:transparent"><ins id="aswift_2_anchor" style="display:block;border:none;height:100px;margin:0;padding:0;position:relative;visibility:visible;width:320px;background-color:transparent"><iframe width="320" height="100" frameborder="0" marginwidth="0" marginheight="0" vspace="0" hspace="0" allowtransparency="true" scrolling="no" allowfullscreen="true" onload="var i=this.id,s=window.google_iframe_oncopy,H=s&amp;&amp;s.handlers,h=H&amp;&amp;H[i],w=this.contentWindow,d;try{d=w.document}catch(e){}if(h&amp;&amp;d&amp;&amp;(!d.body||!d.body.firstChild)){if(h.call){setTimeout(h,0)}else if(h.match){try{h=s.upd(h,i)}catch(e){}w.location.replace(h)}}" id="aswift_2" name="aswift_2" style="left:0;position:absolute;top:0;"></iframe></ins></ins></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script> </center>

感谢您的宝贵时间!

编辑

我已经能够阻止代码显示在网站的桌面版本上,但是当您通过 Facebook 应用内浏览器访问该网站时问题仍然存在。

【问题讨论】:

  • 您的页面中没有包含任何此代码?
  • 我很困惑。您是说您的网页上没有放置 AdSense 广告吗?
  • @DavidP.Caldwell 不,我们在网站其他位置的不同横幅上具有广告意义,但在顶部没有。
  • 你能告诉我们更多细节吗?你的问题太广泛了,除了在黑暗中猜测之外,什么都做不了。
  • @LajosArpad 请帮助我了解哪种方式可以更具体?

标签: php html wordpress ads adsense


【解决方案1】:

你可以这样做:

$(document).ready(function(){
    $('.adsbygoogle').css('display','none');
});

JSFiddle Demo
但这并不是一个很好的解决方法,您应该联系 Google 看看他们是否可以解决它。

【讨论】:

  • 我应该把那个粘贴到哪里?
  • 您的解决方案解决了桌面版网站的问题,但如果从 Facebook 应用内浏览器访问该网站,它仍会显示广告
  • 在手机中查看,并获取那里使用的课程。 Google 可能为移动广告使用了不同的类
【解决方案2】:

根据您的报告,这是我 99.9% 的猜测:您的问题在于您的托管服务提供商,他们试图通过在页面顶部插入广告来从托管网站上赚钱。

虽然您可能会使用一些笨拙的技巧来消除它们(我的猜测是您可以以某种方式使用 JavaScript 遍历 DOM 并删除 DOM 节点,假设您甚至可以对内容进行如此多的控制),我的出于 Stack Overflow 的目的,答案是:寻找不同的托管服务提供商。您甚至可能已经签署了允许他们以这种方式添加广告的协议,在这种情况下,将它们删除可能会违反他们的托管条款。无论如何,允许托管服务提供商在页面顶部插入广告是——我希望——一种非常不常见的方式来做到这一点,所以应该很容易找到一种不会发生这种情况的机制。

不幸的是,关于使用谁作为主机或如何找到主机的讨论超出了 Stack Overflow 的范围。

【讨论】:

  • 我真的怀疑服务器提供商是我的朋友:)
  • 我坚持我的理论,直到你想出另一种解释。代码不仅仅出现在页面中。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多