Trusted WordPress tutorials, when you need them most.
Beginner’s Guide to WordPress
WPB Kupası
25 Million+
Websites using our plugins
16+
Years of WordPress experience
3000+
WordPress tutorials
by experts

WordPress’te Resim Ekleme Sayfaları Nasıl Devre Dışı Bırakılır

Hiç WordPress’te bir resme tıkladığınızda boş bir sayfada tek başına bir resimle karşılaştınız mı? Bu bir resim ekleme sayfasıdır ve ziyaretçileriniz için hiç de hoş bir manzara değildir.

Bu varsayılan ek sayfaları genellikle bağlamdan yoksundur, kötü bir kullanıcı deneyimi sağlar ve SEO’nuza zarar verir. İyi haber şu ki, WPBeginner’da yaptığımız gibi bu sayfaları kolayca devre dışı bırakabilirsiniz.

Hatta ziyaretçileri görselin yer aldığı blog yazısı gibi daha alakalı bir hedefe yönlendirerek daha sorunsuz bir tarama deneyimi yaratabilirsiniz.

Bu makalede, WordPress’te resim ekleme sayfalarını nasıl devre dışı bırakacağınızı ve bunları ana gönderiye nasıl yönlendireceğinizi göstererek, bu çıkmaz resim sayfalarını etkileşim fırsatlarına dönüştüreceğiz.

How to Disable Image Attachment Pages in WordPress

WordPress’te Resim Ekleme Sayfalarını Neden Devre Dışı Bırakmalısınız?

WordPress varsayılan olarak sitenizde bulunan her medya eki için tek bir sayfa oluşturur. Buna resimler, ses ve video dosyaları, PDF’ler ve daha fazlası dahildir.

Bazı kullanıcılar bu işlevi yararlı bulabilir, ancak çoğu WordPress web sitesinin buna ihtiyacı yoktur.

Örneğin, fotoğrafçılar ek sayfalarını faydalı bulabilir. Bir fotoğrafçılık teması EXIF verilerini görüntülemek için ek sayfasını kullanabilir. Bu, kullanılan kamera modelini, kamera ayarlarını ve hatta görüntünün konum verilerini gösterebilir.

Birçok WordPress blog sahibi yanlışlıkla görsellerini görselin kendisi yerine ek sayfalarına bağlar ya da birçok temanın görsel ek sayfaları için özel şablonları olmadığından görselin görünümünü beğenmezler.

Bazen web sitenizdeki bir görsel popüler hale gelebilir ve insanlar doğrudan Google’dan ek sayfasına ulaşmaya başlayabilir. İdeal olarak, ziyaretçilerin gönderinize gelmesini ve görseli kullandığınız bağlamda görmesini istersiniz.

Bu sorunu çözmeye yardımcı olmak için, WordPress’te resim ekleme sayfalarını devre dışı bırakmanın iki farklı yolunu göstereceğiz, böylece sizin için en iyisini seçebilirsiniz:

Yöntem 1: WordPress’te Resim Ekleme Sayfalarını Devre Dışı Bırakın (Bir Eklenti ile)

Resim ekleme sayfalarını devre dışı bırakmanın en kolay yolu All in One SEO (AIOSEO) kullanmaktır. Bu, 3 milyondan fazla site tarafından kullanılan WordPress için en iyi SEO eklentisidir.

Yapmanız gereken ilk şey ücretsiz All in One SEO eklentisini yüklemek ve etkinleştirmektir. Bunu yapmak için WordPress eklentisi yükleme kılavuzumuza bakın.

Eklenti kurulup etkinleştirildikten sonra, ‘All in One SEO’ adında yeni bir menü öğesine sahip olacaksınız.

All in One SEO ” Arama Görünümü bölümüne gidin. Ardından, ‘Görsel SEO’ gezinme sekmesine tıklayın.

All in One SEO search appearance media setting

İlk ayar ‘Ek URL’lerini Yeniden Yönlendir’dir. Ayarı tamamen devre dışı bırakabilir veya ek sayfasına ya da ek üst sayfasına yönlendirebilirsiniz.

‘Ek Ebeveyni’ sayfasına yönlendirmenizi öneririz. Bu şekilde, bir kullanıcı resim eki sayfasına geldiğinde, bunun yerine makalenize yönlendirilecektir.

Not: Bir medya veya görselin bir üst sayfası yoksa, yani bir gönderiye veya sayfaya yüklenmemişse, AIOSEO görselin ek sayfasını görüntüleyecektir.

Tercih ettiğiniz ayarı seçtikten sonra, ekrandan çıkmadan önce ‘Değişiklikleri Kaydet’e tıklamanız yeterlidir.

Yöntem 2: WordPress’te Resim Ekleme Sayfalarını Devre Dışı Bırakın (Kod Parçacığı ile)

Diğer bir seçenek de WordPress’e bir kod parçacığı eklemektir. WordPress dosyalarınızı doğrudan düzenlemenizi önermiyoruz, bu nedenle bu eğitim için WPCode kullanacağız.

Başlamak için ücretsiz WPCode eklentisini yüklemeniz gerekecektir. Daha fazla ayrıntı için WordPress eklentisi yükleme kılavuzumuza bakın.

Etkinleştirmenin ardından, yönetici kontrol panelinizde Kod Parçacıkları ” Parçacık Ekle bölümüne gitmeniz gerekecektir.

Ardından, arama alanına ‘ek’ yazmanız yeterlidir. Sağ tarafta ‘Ek Sayfalarını Devre Dışı Bırak’ başlıklı bir snippet görünmelidir.

Üzerine geldiğinizde, ‘Snippet Kullan’ düğmesine tıklayın.

Using WPCode search to remove attachment pages

Tüm ayarların sizin için otomatik olarak ayarlandığı ‘Snippet Düzenle’ sayfasına yönlendirileceksiniz.

Tek yapmanız gereken anahtarı ‘Aktif’ konumuna getirmek ve ‘Güncelle’ düğmesine tıklamaktır.

Clicking the toggle to activate a code snippet in WPCode before hitting update

Artık bir kullanıcı resim ekleme sayfanıza geldiğinde üst gönderiye yönlendirilecektir. Görsel için bir üst gönderi yoksa, kullanıcı sitenin ana sayfasına yönlendirilecektir.

Umarız bu makale WordPress’te resim ekleme sayfalarını devre dışı bırakmanıza yardımcı olmuştur. Ayrıca yeni başlayanlar için görsel SEO kılavuz umuza ve WordPress’te yaygın görsel sorunlarının nasıl giderileceğine ilişkin kılavuzumuza da göz atmak isteyebilirsiniz.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

Açıklama: İçeriğimiz okuyucu desteklidir. Bu, bazı bağlantılarımıza tıklarsanız komisyon kazanabileceğimiz anlamına gelir. WPBeginner'ın nasıl finanse edildiğini, neden önemli olduğunu ve nasıl destek olabileceğinizi görün. İşte editoryal sürecimiz.

Avatar

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi with over 16 years of experience in WordPress, Web Hosting, eCommerce, SEO, and Marketing. Started in 2009, WPBeginner is now the largest free WordPress resource site in the industry and is often referred to as the Wikipedia for WordPress.

Ultimate WordPress Araç Kiti

Araç setimize ÜCRETSİZ erişim sağlayın - her profesyonelin sahip olması gereken WordPress ile ilgili ürün ve kaynaklardan oluşan bir koleksiyon!

Reader Interactions

72 yorumBir Cevap Bırakın

  1. Hajjalah

    Surely, most of the new bloggers face the issue of attachment pages being indexed. When i read this article, i went straight to google search and found very many attachment pages when i searched for my website domain. Luckily, this article clearly guided me throughout the entire process of stopping the useless practice. But when i tried to remove the indexed pages from Google Search Console, the only option was to temporarily remove the pages for six months . i don’t know why i can’t use the permanent removal feature.

    • WPBeginner Support

      When Google recrawls your site it will see the markup to not index those pages and not include them in search results.

      Yönetici

  2. Mrteesurez

    I want to ask if the image attachment page affect SEO in the sense that some page like tags and some taxonomies are showing on Google with no contents.
    This makes search engine thinks the blog has little contents on his blog ?

    • WPBeginner Support

      It can affect SEO, if you are not specifically using the attachment pages for some reason then we would recommend disabling them.

      Yönetici

  3. Matt

    Worked perfectly! I used the code method of setting up an image.php file with the code snippet. Works perrrfect.

    • WPBeginner Support

      Glad our guide was helpful!

      Yönetici

  4. SHUBHAM GARG

    Why don’t you update this article ?

    Yoast doesn’t have this feature in free version anymore.

    • WPBeginner Support

      We are updating our articles as fast as we are able. For the moment you may want to check under Search Appearance > Media

      Yönetici

    • Dave

      My Yoast SEO does have this option under MEDIA. It is the first option, and it says Yoast suggests YES to “Redirect attachment URLs to the attachment itself?”
      March 2021 is when I checked.

  5. Abhishek

    i post images and link them to media file on my site
    should i disable the attachment media pages?
    if i do, will it affect seo?

    • WPBeginner Support

      That would depend on your personal preference and if the main content of your site is images rather than posts and pages.

      Yönetici

  6. Tommy

    Thank you! For some reason I have never experienced this issue using yoast until today! One of my sites kept redirecting to the image instead of my attachment page. Wasted an hour trying to figure out if it was a function issue I had created. Turns out it was the Yoast plugin. Easy fix thank yoU!

  7. Esther Roche

    Hi
    Yoast has now changed all the settings, they keep doing this and honestly they’re driving people mad.
    This “Redirect attachment URL to parent post” was very handy and understandable, but now it doesn’t exist.
    Instead, we have a Media tab where the instructions seem, at least for me, a bit unclear. This is the explanation they give:

    When you upload media to WordPress, it doesn’t just save the media, it creates an attachment URL for it. These attachment pages are quite empty: they contain the media item and maybe a title if you entered one. Because of that, if you never use these attachment URLs, it’s better to disable them, and redirect them to the media item itself.

    What this seems to provoke is that now Google is showing image attachment URLs in the SERPs results. But there is no option, as before, to redirect the attachment URL to the parent post. What do we do then?

    Am I not understanding correctly the use of the new Media tab? What should I do so that Google doesn’t show those attachments as results in the SERPs that are not image search? Am I not understanding correctly the use of the new Media tab? What should I do so that Google doesn’t show those attachments as results in the SERPs that are not image search? What is it that I’m getting wrong?

    H E L P!!

    • Sevda

      Hi Esther,
      The current function in Yoast removes the attachment urls by redirecting them to the direct url of the media file (instead of to the parent post). If you are turning it on just now, it’s normal to still have attachment page urls in the index. Selecting the option would lead to the attachment urls eventually disappearing from search engines’ indexes and being replaced by the media files’ direct urls (blabla.jpg for example).
      If you want to speed up the removal of the attachment urls, you can do so in Google Search Console.

  8. Max Dai

    This post needs an update because Yoast has made a lot of changes to its features on new update.

    • Amanda Formaro

      I agree. Not only did Yoast update, but they also removed the very option you are recommending in this post (unfortunately). And now all that’s left is to redirect to the actual attachment. :(

  9. Colin

    The link is out of date now as the permalinks can be found under Advanced on the latest version.

    Thanks anyway as I have just updated it.

  10. Jeff

    So if we aren’t linking to these attachment pages, is there really any reason to redirect these so google doesn’t index them? The reason I ask is for videos directly uploaded, we have the transcript in the description field so google indexes that.

    If we redirect would it still index that transcript or should I leave as is?

  11. beginner

    i was using all in one seo plugin and i found “Redirect Attachments to Post Parent:” in my seo General settings, and i mark it.

    So, is that same and worked?

  12. javidan

    hi
    witch one is better for SEO
    nofollow no index or disable ?
    thank you

  13. Pedro

    Thank you SO much! This simple thing helped me a lot. :)

  14. Michael Peters

    Question: How can I keep WP from creating an attachment in the database?
    What I mean is that I have roughly 40k actual posts, and over 100k rows in the wp_posts table. After running a query, it seems that there is ~100k posts with post_type “attachment.” Are all of these rows necessary?

  15. Mem

    Thanks exactly what I was looking for. I use yoastSEO so it was a single click.

  16. Ben

    Or You can write this line on robots.txt

    Disallow: /wp-content/uploads/

  17. Ajit

    Thank you, yes I done, very helpful topics, thank you again

  18. Laurence Cope

    But how do you actually disable attachment pages? This post doesn’t disable them but puts a redirect in place. We have issues where the redirects is conflicting with actual page names. We dont want any attachment pages and therefore no need for redirects.

  19. paul

    I would like to keep the attachment pages but within the attachment pages that display the image in a bigger size to disable links to prev next and full size image as this is where they can copy images or see images that I dont want non registered users to see etc. How can we do that?

  20. Whitney

    Oh wait, I just realized something… if I no index the media files, does that mean all my media is not indexed or just the attachment pages?

  21. Whitney

    Is the duplicate content issue only solved if I “no index” the pages or will the 301 redirect to parent take care of that too? I’m assuming I’d need to no index them…. but just want to make sure I’m assuming right :)

  22. Muhammad Furqan

    Hello i also disabled attachments pages in sitemap. will this technique prevents google to index images?

    • WPBeginner Support

      If the images appear in posts as well, then no it will not stop Google from indexing images.

      Yönetici

  23. Sophia Martin

    Thanks for the quick help, it fixed things at once!

    Thanks again!

  24. marco

    Great solution!
    May I add that after the modification on Yoast I had to go to Settings->Permalinks and save settings (no need to change anything).
    Your mileage may vary, this worked for me, thanks!

  25. Stef

    It seems Yoast has changed things and this no longer works. Or something is stuck in cache.

    • Jodi

      I’m having the same issue and I don’t think it’s the cache. I installed the plugin mentioned and that works fine.

    • Adrian Thompson

      I had to go to Settings > Permalinks and click Save Changes (without making any changes) in order for it to work after the Yoast setting change.

      Hope it works for you.

  26. Hicham

    Hi,

    Please how to create image.php ?

    Thank you

  27. Henry

    A nice informative article but oh my what a misleading title!
    The post title and the last sentence (after the comma) of the first paragraph are totally off!!!

    This is NOT disabling attachment pages/nor stopping WP from creating them (as the title implies) but redirecting links to it to somewhere else, and that is something real different!

    Disabling is stopping some from to be happen, and whatever code is shown in this article (even used by named plugins) it is not stopping WP from creating these attachment pages. This article is about how to redirect , which is okay ofcourse but not as implied by the post title and article as it. Such a shame because that would be a scoop!

    • Jesse

      Henry has pointed out an important distinction.

      I am building a site that requires members to upload sensitive/private information via registration form. We absolutely can not have these files accessible to the public and need minimize any chance that these files will be indexed and publicly visible. Preventing the creation of attachment pages would seem the way to go, but I supposed redirects would work as well. We wouldn’t want to outright disable all attachment pages as we do want some uploaded files to be indexed, however, as WP Beginner Support pointed out, these files can still be indexed if they are contained within other posts.

      Think I will try enabling the attachment page redirects via Yoast SEO plugin as well as change the default directory where registration form uploads are stored (ie. will no longer be in default ‘/uploads’ directory) and disable indexing of that directory via robots.txt.

      Thoughts?

  28. Angela

    Hi, thanks for the info!

    What about older images which were previously indexed by Google?

    I have had the setting on in Yoast for “redirect attachments” for at least 6 months now, but my older images are still being found.

    What would anyone recommend to do with these images? It concerns me because I get some critical errors on the ahrefs tool:

    duplicate title tags
    duplicate meta descriptions

    Shall I just go and add all the tags?

  29. Simon G.Proudfoot

    Putting the line in my image.php file worked perfectly. It was giving me a bad SEO score beforehand as the links to the images weren’t mobile friendly. This has fixed it. Thanks :)

  30. Priyanka Biswas

    Glad I found this article. Was wondering why Google was showing all my image attachment pages in the search results. This helps! Thank you.

  31. Raleigh Leslie

    Thanks this post helped me explain to someone why you would want to redirect media attachment pages to the actual post of page containing to media. re: “Sometimes an image on your website can become popular and people might start landing on the attachment page directly from Google. Ideally you would want them to land on your post and see the image in the context you have used it.”

    Word!

  32. sam

    mine is already checked but doesn’t work, all my images redirected to an other page :(

  33. Catherine

    Thank you so much for helping me solve the problem of image attachments. I inserted the code

    post_parent)); ?>
    into my image.php file and it worked like a charm.
    So will Google now de-index my attachment page url’s?

  34. Chris Cox

    Ok. Using the php code (no plugin) what happens if there are two pages/posts using the same image?

  35. ashar

    I just checked the redirect in SEO as these things were driving me nuts. so glad I found you. thanks – best ashar

  36. Tonya

    Thank you! This was an excellent tip, just what I needed to help clean up errors found by Google.

  37. Jorge Pinto

    I tryed the code you suggest, it works with the images associated with posts os pages, but.. all the other images uploaded that are no assigned to any post, for that images your code does not work.

    • Ogier Schelvis

      I also had this issue. The Yoast! setting seemed to be ignored. Whether or not it was cache, I like the fact about the image.php solution that you have more freedom to determine what is going to happen. I just wanted to show a 404 for example if the post parent was not set. I solved it like this:

      if($post->post_parent != 0):
      wp_redirect(get_permalink($post->post_parent));
      else:
      $wp_query->set_404();
      status_header(404);
      nocache_headers();
      include( get_query_template( ‘404’ ) );
      endif;

  38. philip

    Hello a user called Sam posted this issue – You write “Simply check the noindex, nofollow tag for ONLY the attachment post type.” but I do not see such an option. Are you referring to the “media” section? If I click no index under media will that no index my images or attachments? I would like to no index my attachments but I don’t want to lose traffic from Google images.

    I would also like to know the answer as I have the same issue
    thanks
    philip

    • WPBeginner Support

      Philip, no this should not affect your Google Image Search traffic as the option redirects users landing on attachment page to the parent post URL where your image is available for search engines to index.

      Yönetici

  39. Jess

    Is it ok to delete the attachment posts in phpMyAdmin?

  40. karen

    I tried adding the code you have given to my image.php file and it worked beautifully. thank you!

  41. Sam

    You write “Simply check the noindex, nofollow tag for ONLY the attachment post type.” but I do not see such an option. Are you referring to the “media” section? If I click no index under media will that no index my images or attachments? I would like to no index my attachments but I don’t want to lose traffic from Google images.

  42. Elektra

    thanks so much for posting! very useful info and straight forward! appreciated!!

  43. Mark Law

    Thanks for the heads up, I got a bit of a shock when I saw absolutely everything had been indexed, including elements of the template such as image backgrounds and so on. I’m using Yoast so it is an easy fix – I wonder though if it is worth still having pdf attachment pages indexed – I’ll look into it.

  44. Junaid Abbas

    Is this possible to stop attachment pages to be indexed??? I do not want to redirect them to the home page. I just want to stop indexing them.

  45. Mark

    I love the Internet, within 2 mins of discovering an issue, I had found this post and resolved the problem! Thank you wpbeginner.com

  46. Shannon

    Will this also fix the issue with creating duplicated content where the image holds the same title as the associated post?

  47. Bruce Simmons

    Heads up about the plugin… if you use the gallery option to present images in a post, the plugin blocks the function and clicking on an image brings the user back the thumbs index of the images.
    -Bruce

Bir Cevap Bırakın

Yorum bırakmayı seçtiğiniz için teşekkür ederiz. Lütfen tüm yorumların yorum poli̇ti̇kasi uyarınca denetlendiğini ve e-posta adresinizin yayımlanmayacağını unutmayın. Ad alanında anahtar kelime KULLANMAYIN. Kişisel ve anlamlı bir sohbet edelim.