Remove google ads from blogger post preview page

Today i got a warning from Google Adsense "There are unauthorized sites that have displayed ads using your AdSense publisher ID within the last week. Please click here..." etc.

I have added all my websites in my adsense authorization page & currently site authorization is active.

In the adsense pageview page, finally i got the url like

'4492560067822442951_160e48051667999' is equalant of my blogger subdomain.i.e =

I have a blogger blog with a custom domain. Before publish the post i click on the preview button, it open new tab & show the post preview.

The preview url is like this ""

I think this is the reason for adsense warning.

I had tried to add this domain in adsense authorization page. But invalid url error occured.

How can i solve this problem?
Please take your blogger backup before doing this step.


Check if your url contain 'post-preview', the just remove all the google adsense code by using JavaScript or JQuery

Add a div as a wrapper for Google ad code
<div class='GoogleAdsWrapper'>
<!-- Add your adsense code here -->
1) By using JQuery
Add JQuery API. If already added in your blogger ignore it
<script src=""></script>
Find '$( document ).ready(function() '. If it is found, then add the below lines into it
var CurrentURL = window.location.href;
if( >= 0 && >= 0)
If it is not found add the below lines just before '</head>' tag.
$( document ).ready(function()
    var CurrentURL = window.location.href;
    if( >= 0 && >= 0)
2) By using JavaScript
Add the below lines just before '</head>' tag.
var child = document.getElementsByClassName("adsbygoogle");
var Parent = child.parentNode;
while (Parent.hasChildNodes())

No comments:

Post a Comment