The new version of WordPress 2.0 is one of the most popular and powerfull script for blogs.
Few of the webmasters know that this new version can violate the AdSense rules.
In this version, WordPress introduced a live post preview. If you scroll to the bottom of the page while editing a post, you’ll see a live preview of how your page will look once it’s published. This is a very nice addition to WordPress, but for AdSense publishers, and those using other context-targeted ad networks, it presents a serious problem.
When the post preview is rendered, it will try to fetch your Google ads!
And because the post hasn’t been published yet, when Google’s bot tries to crawl the page a few seconds later, it will receive a 404 error.
The best case scenario for this is that some of you (who don’t use permalinks) will receive very poorly targeted ads for up to two weeks after you publish your post.
And the worst case scenario, since Google prohibits displaying ads on 404 pages, is that you could get your account suspended.
WordPress 2.0 does provide a solution, though; it’s the new is_preview template tag. This new tag tells whether the post is being displayed in the post preview section while it’s being edited.
So all you need to do is to add in a check for this into your template code wherever you have placed AdSense, and the problem will be solved. Just add this code around your AdSense code:
< ?php if (!is_preview()): ?>
// Paste your AdSense code here //
< ?php endif; ?>
This way, the post preview will not try to show Google ads, and they will only be shown once your post is published. This will keep your AdSense account safe and your ads well-targeted.
More info can be found here