1. Halo Guest, pastikan Anda selalu menaati peraturan forum sebelum mengirimkan post atau thread baru.

WordPress 2.0 problems for google adsense users, and a workaround

Discussion in 'Wordpress' started by postman, Jul 23, 2006.

  1. postman

    postman Ads.id Fan

    Joined:
    Apr 24, 2006
    Messages:
    194
    Likes Received:
    0
    As just another reason to not upgrade to WordPress 2.0 (or even install it in the first place for now), it’s been widely reported that WP 2.0’s live preview feature causes serious problems for those bloggers who utilize Google’s Adsense to monetize their blogs.

    Lunacy Unleashed has a great article on dealing with the adsense problems in Wordpress 2.0 dealing with the adsense problems in Wordpress 2.0, as well as a few workarounds.

    In sum, the problem stems from the fact that the live preview will try to fetch your google adsense ads, even if your post has not yet been published. This can be seriously problematic, as when google tries to determine appropriate contextually relevant ads for the page, it receives a 404 (page not found) error because the page does not yet exist. At a minimum, this could result in ads that aren’t relevant to the content on your page. At it’s worst, it could result in your adsense account being suspended, “since Google prohibits displaying ads on 404 pages”.

    Not good.

    Michael Hampton’s post provides details on how to get around this problem by modifying your template code (which beginning WP users are probably not so comfortable doing..) to put in a check to see if the what’s being displayed is a preview, and if so not display AdSense ads using the following code:


    // Paste your AdSense code here //

    Unfortunately, this workaround still results in multiple problems, the first one being that there is a known bug with the is_preview() function in WP 2.0. Furthermore, the abovementioned code only works ‘inside the loop’ (see Matt Read’s post for help in understanding “the loop”, as well as the information on The Loop in the wordpress codex)

    Michael suggests yet another workaround for those who want to place their ads outside the loop (a common occurence) in the form of the following code:

    is_preview): ?>
    // Paste your AdSense code here //

    HOWEVER, because of the problems with the is_preview function being quirky in WP 2.0, these workarounds don’t always work and in the words of EUGENIUS, “It looks like until is_preview is fixed, don’t put adsense on the WordPress (2.0) blog.”

    To me, I find this unbelievably unacceptable -with the given propensity for the majority of bloggers these days to utilize Google AdSense ads on their blogs, I simply cannot understand how it is possible that this was not resolved prior to WordPress 2.0’s being released, and is reason alone not to use it (never mind upgrade your existing installations to WP 2!) And shouldn’t there be a simple checkbox to just turn live preview off for those of us who would rather have AdSense ads working on our site than see a live preview of our post?? How hard would that really be?

    bener gak siy ????
     
  2. cosa

    cosa Super Hero

    Joined:
    Aug 30, 2005
    Messages:
    1,561
    Likes Received:
    168
    bener, cmn rasanya gak terlalu masalah sih.

    Solusi sementara, bisa diilangin Live Preview-nya kalo mau.

    1. buka wp-admin/post.php
    2. di baris 84 (WP 2.03) ada tag <iframe>. Hapus aja 1 baris ini.
    3. save and done :)
     

Share This Page