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

Cara Redirect / No Index Attachment Page Wordpress

Discussion in 'Wordpress' started by airul, Jan 20, 2013.

  1. airul

    airul Super Hero

    Joined:
    Nov 11, 2011
    Messages:
    2,256
    Likes Received:
    668
    Location:
    Magetan
    Mau bagi2 pengalaman aja ni.
    Blog ane tiba2 anjlok cari penyebabnya kesana kemari akhirnya nemu juga di webmaster tool

    Ternyata penyebabnya adalah Duplicate meta descriptions.

    Yg disebabkan oleh halaman post dan halaman attachment (Gambar/File)
    mempunyai meta deskripsi yg sama.

    Disini saya menemukan 2 cara untuk mengatasinya.
    1. Dengan cara redirect page attachment ke page utama (posting)
    2. Dengan cara menambah meta no index ,supaya page attachment gak ke index oleh google.

    Oke lanjut cara pertama
    Tinggal tambahin di header.php diantara <head> </head>

    PHP:
    <?php
    if(is_attachment()) {
    wp_redirect(get_permalink($post->post_parent));
    }
    ?>
    Cara yg kedua hampir sama. seperti diatas .hanya beda script aja.
    PHP:
    <?php
    if(is_attachment()) {
    ?>
    <meta name="robots" content="noindex, nofollow" />
    <?php
    }
    ?>
    semoga bermanfaat.
     
    sathreea, jakasembung, aseta and 3 others like this.
  2. FuLan

    FuLan Ads.id Starter

    Joined:
    Jun 18, 2011
    Messages:
    73
    Likes Received:
    28
    kalau pake wp_redirect pastiin nambahin exit();

    trus secara default, redirect status 302(temporary)
    PHP:
    wp_redirect(get_permalink($post->post_parent),301);
    exit();
     
  3. airul

    airul Super Hero

    Joined:
    Nov 11, 2011
    Messages:
    2,256
    Likes Received:
    668
    Location:
    Magetan
    Tnx gan udah nambahin.

    btw.punya ane pke cara diatas udah bisa redirect ke halaman post.
     
  4. demangan154

    demangan154 Newbie

    Joined:
    Jun 10, 2012
    Messages:
    9
    Likes Received:
    0
    Location:
    yogyakarta
    Ane jg punya masalah yg sama GanStah,

    duplikat meta deskripsi & duplikat title tags. kalo pake cara noindex, itu tinggal taruh di <head>..</head>?
    sementara ane pake platinum, disitu uda d'set gni,
    <meta name="robots" content="index,follow,noodp,noydir" />waktu ane coba pasang script noindexnya.. trus ta ctrl+U gak kelihatan

    <?php if(is_attachment()) { ?><meta name="robots" content="noindex, nofollow" /> <?php } ?>


    ??? bngung gan, Newbie:pusing:
     
  5. indulgencion

    indulgencion Super Hero

    Joined:
    Jul 29, 2013
    Messages:
    1,456
    Likes Received:
    46
    Location:
    potrobangsan
    Kalo bikin halaman awal kayak di situs 18+ gimana ya? Maksudnya ntar ada blablabla I AGREE ENTER atau DISAGREE LEAVE :lol:

    Sent from my E860 using Tapatalk 4 Beta
     
  6. siprof

    siprof Reviewer

    Joined:
    Jun 4, 2011
    Messages:
    845
    Likes Received:
    28
    kalo ane ga pake mode attachment gan. ane pake mode media link atau bahkan mode none. kasihan buat yg mau save gambar kalo pake mode attachment :D
     
  7. prahman

    prahman Newbie

    Joined:
    Apr 28, 2014
    Messages:
    29
    Likes Received:
    0
    Location:
    Sukabumi

    di theme ane gk bisa yah gan... eror malah....
     
  8. heristbd

    heristbd Hero

    Joined:
    May 30, 2013
    Messages:
    696
    Likes Received:
    25
    Location:
    Cikarang, Jawa Barat, Indonesia
    Ketemu nih panduang yang dicari.. thx gan
     
  9. sathreea

    sathreea Super Hero

    Joined:
    Jun 13, 2011
    Messages:
    7,720
    Likes Received:
    1,001
    Location:
    Purwokerto, Jawa Tengah, Indonesia
    thanks om, jadi ga perlu pake plugin
     
  10. AdhyKun

    AdhyKun Super Hero

    Joined:
    Jan 17, 2012
    Messages:
    872
    Likes Received:
    42
    Location:
    Bengkulu - Yogyakarta - Solo
    Bisa kok gan pakek cara lain lagi.. attacment ttep di index, buat nambah" index.... untuk mengatasi duplicatenya

    di header.php

    PHP:
    if (is_attachment()) {
    <
    title>TITLE<title>
    <
    meta name="description" content="DESKRIPSI">
    }

    kalau single
    if (is_single())

    dst...
    _codex.wordpress.org/Function_Reference/is_attachment

    Semoga membantu.. :)
     
  11. Dwipangga

    Dwipangga Super Hero

    Joined:
    Mar 25, 2010
    Messages:
    3,142
    Likes Received:
    297
    Location:
    Home
    kalo cara pertama oe biasa pake plugin yoast...

    biasa ada pada bagian advance ( kalo ga salah )
     
  12. sathreea

    sathreea Super Hero

    Joined:
    Jun 13, 2011
    Messages:
    7,720
    Likes Received:
    1,001
    Location:
    Purwokerto, Jawa Tengah, Indonesia
    Ini fungsinya buat apa om?
     
  13. AdhyKun

    AdhyKun Super Hero

    Joined:
    Jan 17, 2012
    Messages:
    872
    Likes Received:
    42
    Location:
    Bengkulu - Yogyakarta - Solo
    Untuk mengobati duplicate description...
     
  14. wimaogawa

    wimaogawa Ads.id Starter

    Joined:
    Nov 11, 2015
    Messages:
    54
    Likes Received:
    4
    Bisa untuk mengatasi title tag gak nih? Duplikat ada ribuan [emoji16]

    Sent from my Redmi 5A using Tapatalk
     
  15. socket 478

    socket 478 Ads.id Fan

    Joined:
    Oct 16, 2009
    Messages:
    190
    Likes Received:
    11
    Ini keknya di yoast SEO ada pengaturannya. Ubek2 aja. Ane ga apal di menu config ya. Ntar coba kl pas buka lewat laptop.

    Cmiiw

    Sent from my Redmi 4A using Tapatalk
     

Share This Page