Quantcast
Channel: WordPress.org Forums
Viewing all articles
Browse latest Browse all 46187

lutetia on "How to block Adsense from appearing on post preview"

$
0
0

Hi All,

I have Adsense ad units integrated into my blog's header and post template files.

In the past, when I would create a post and use the preview function to see how it looked, Adsense ads did not appear at all in the preview.

But with subsequent updates to Wordpress (it seems), this is no longer the case. The ads do show up in the preview version of the post.

Does anyone know how I can effectively prevent Adsense ads from showing up in post previews. Is there a snippet of code I can insert somewhere? Should my Robots.txt file be changed in some way?

I recently created a Robots.txt file (below) but am now getting some "failed crawl requests" show up in my account.

User-agent: Mediapartners-Google
Disallow:

User-agent: ia_archiver
Disallow: /

User-agent: *
Disallow: /?p=*
Disallow: /cgi-bin/
Disallow: /wp-admin/
Disallow: /wp-includes/
Disallow: /wp-content/plugins/
Disallow: /wp-content/cache/
Disallow: /wp-content/themes/
Disallow: /trackback/
Disallow: /comments/
Disallow: /category/*/*

Any suggestions would be much appreciated.


Viewing all articles
Browse latest Browse all 46187

Trending Articles