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

Disable Outgoing link on Comment Page

Discussion in 'SEO Tips' started by beauty mart, Jun 13, 2011.

  1. beauty mart

    beauty mart Ads.id Fan

    Joined:
    Apr 19, 2011
    Messages:
    132
    Likes Received:
    2
    siang all, pak momod, mimin, master2 , and semua keluarga besar adsense id yang cakep2.

    sesuai dengan title saya ingin share cara disable outgoing link on comment page. karena biasanya banyak blog kita yang jadi sasaran spammer, mau di approve banyak livelink, gak di approve juga kurang baik buat seo ( menurut saya sih ).

    nah apalagi blog agan udah ber PR..heheh sayangkan klo kebanyakan outgoing link. langsung aja ikuti praktek newbie di bawah ini.


    1. go to cpanel -- masuk wp-includes
    2. cari file comment-template.php lalu edit
    3. find php tag berikut = get_comment_author_link View attachment 8435
    4. lalu rubah code
      Code:
      $return = "<a href='$url' rel='external nofollow' class='url'>$author</a>";
      dengan
      Code:
      $return = "$author";
      View attachment 8436
    5. lalu save pekerjaan kamu.
    6. langkah selanjutnya, masuk ke theme editor,buka theme function.php
    7. copas kode berikut ini di bawah php tag atau sebelum code ?>
    remove_filter(‘comment_text’, ‘make_clickable’, 9);

    // This will occur before a comment is displayed
    function plc_comment_display( $comment_to_display ) {

    // Put the single quotes back in
    $comment_to_display = str_replace( '&apos;', "'", $comment_to_display );

    return $comment_to_display;
    }

    add_filter( 'preprocess_comment', 'plc_comment_post', '', 1);
    add_filter( 'comment_text', 'plc_comment_display', '', 1);
    add_filter( 'comment_text_rss', 'plc_comment_display', '', 1);
    add_filter( 'comment_excerpt', 'plc_comment_display', '', 1);
    add_filter('comment_text', 'wp_filter_nohtml_kses');
    add_filter('comment_text_rss', 'wp_filter_nohtml_kses');
    add_filter('comment_excerpt', 'wp_filter_nohtml_kses');
    add_filter('comment_text', 'wp_filter_nohtml_kses');

    if(eregi("google",$_SERVER['HTTP_USER_AGENT'])) {
    if (!class_exists('ExternalNofollow')) {
    class ExternalNofollow
    {
    static function init()
    {
    add_filter('the_content', array(__CLASS__, 'nofollow'));
    }

    function nofollow($content)
    {
    //return stripslashes(wp_rel_nofollow($content));

    return preg_replace_callback('/<a[^>]+/', array(__CLASS__, 'callback'), $content);
    }

    function callback($matches)
    {
    $link = $matches[0];
    $site_link = get_bloginfo('url');

    if (strpos($link, 'rel') === false) {
    $link = preg_replace("%(href=\S(?!$site_link))%i", 'rel="nofollow" $1', $link);
    } elseif (preg_match("%href=\S(?!$site_link)%i", $link)) {
    $link = preg_replace('/rel=\S(?!nofollow)\S*/i', 'rel="nofollow"', $link);
    }

    return $link;
    }
    }

    ExternalNofollow::init();
    }
    }

    nah, mungkin sdikit tips diatas bisa bermanfaat, cukup segini ja ya...mohon maaf jika salah, klo repost di close juga gpp

    oia sori lupa gak afdol klo gak ada contoh, dikirain, gak work ntar codenya = ni contohnya ==> freehostingplan,info
     
  2. menilajah

    menilajah Super Hero

    Joined:
    Mar 29, 2011
    Messages:
    3,389
    Likes Received:
    582
    Location:
    BE 64 UL BandarLampung-ID
    thanks gan, nice tips,berguna bgt buat ane yg newbie
     
  3. yumichan

    yumichan May All Beings Be Happy

    Joined:
    May 19, 2011
    Messages:
    7,016
    Likes Received:
    847
    mantep tipsnya masbro.. sangat berguna buat nubie kayak saya.. ternyata bs lgs diedit dari situ ya :D
     
  4. beauty mart

    beauty mart Ads.id Fan

    Joined:
    Apr 19, 2011
    Messages:
    132
    Likes Received:
    2
    demen ma signature nya agan...
     
  5. menilajah

    menilajah Super Hero

    Joined:
    Mar 29, 2011
    Messages:
    3,389
    Likes Received:
    582
    Location:
    BE 64 UL BandarLampung-ID
    :D Hanya saling mengingatkan gan, bukan kah agan juga sudah berbagi pengetahuan dgn share begini?
     
  6. ryuhasato

    ryuhasato Ads.id Fan

    Joined:
    Oct 2, 2010
    Messages:
    133
    Likes Received:
    0
    nice share gan :D
     
  7. beauty mart

    beauty mart Ads.id Fan

    Joined:
    Apr 19, 2011
    Messages:
    132
    Likes Received:
    2
    heheh iya gan,,,lagian klo sell terus sapa yang beli :d
     
  8. comsoft

    comsoft Super Hero

    Joined:
    Mar 1, 2011
    Messages:
    902
    Likes Received:
    102
    Location:
    Jakarta
    makasih gan atas ilmunya, sukses terus buat ente :)) (ane juga...wkwkwk)
     

Share This Page