undefined
Skip to content
Moz logo Menu open Menu close
  • Products
    • Moz Pro
    • Moz Pro Home
    • Moz Local
    • Moz Local Home
    • STAT
    • Moz API
    • Moz API Home
    • Compare SEO Products
    • Moz Data
  • Free SEO Tools
    • Domain Analysis
    • Keyword Explorer
    • Link Explorer
    • Competitive Research
    • MozBar
    • More Free SEO Tools
  • Learn SEO
    • Beginner's Guide to SEO
    • SEO Learning Center
    • Moz Academy
    • SEO Q&A
    • Webinars, Whitepapers, & Guides
  • Blog
  • Why Moz
    • Agency Solutions
    • Enterprise Solutions
    • Small Business Solutions
    • Case Studies
    • The Moz Story
    • New Releases
  • Log in
  • Log out
  • Products
    • Moz Pro

      Your all-in-one suite of SEO essentials.

    • Moz Local

      Raise your local SEO visibility with complete local SEO management.

    • STAT

      SERP tracking and analytics for enterprise SEO experts.

    • Moz API

      Power your SEO with our index of over 44 trillion links.

    • Compare SEO Products

      See which Moz SEO solution best meets your business needs.

    • Moz Data

      Power your SEO strategy & AI models with custom data solutions.

    NEW Keyword Suggestions by Topic
    Moz Pro

    NEW Keyword Suggestions by Topic

    Learn more
  • Free SEO Tools
    • Domain Analysis

      Get top competitive SEO metrics like DA, top pages and more.

    • Keyword Explorer

      Find traffic-driving keywords with our 1.25 billion+ keyword index.

    • Link Explorer

      Explore over 40 trillion links for powerful backlink data.

    • Competitive Research

      Uncover valuable insights on your organic search competitors.

    • MozBar

      See top SEO metrics for free as you browse the web.

    • More Free SEO Tools

      Explore all the free SEO tools Moz has to offer.

    NEW Keyword Suggestions by Topic
    Moz Pro

    NEW Keyword Suggestions by Topic

    Learn more
  • Learn SEO
    • Beginner's Guide to SEO

      The #1 most popular introduction to SEO, trusted by millions.

    • SEO Learning Center

      Broaden your knowledge with SEO resources for all skill levels.

    • On-Demand Webinars

      Learn modern SEO best practices from industry experts.

    • How-To Guides

      Step-by-step guides to search success from the authority on SEO.

    • Moz Academy

      Upskill and get certified with on-demand courses & certifications.

    • MozCon

      Save on Early Bird tickets and join us in London or New York City

    Unlock flexible pricing & new endpoints
    Moz API

    Unlock flexible pricing & new endpoints

    Find your plan
  • Blog
  • Why Moz
    • Small Business Solutions

      Uncover insights to make smarter marketing decisions in less time.

    • Agency Solutions

      Earn & keep valuable clients with unparalleled data & insights.

    • Enterprise Solutions

      Gain a competitive edge in the ever-changing world of search.

    • The Moz Story

      Moz was the first & remains the most trusted SEO company.

    • Case Studies

      Explore how Moz drives ROI with a proven track record of success.

    • New Releases

      Get the scoop on the latest and greatest from Moz.

    Surface actionable competitive intel
    New Feature

    Surface actionable competitive intel

    Learn More
  • Log in
    • Moz Pro
    • Moz Local
    • Moz Local Dashboard
    • Moz API
    • Moz API Dashboard
    • Moz Academy
  • Avatar
    • Moz Home
    • Notifications
    • Account & Billing
    • Manage Users
    • Community Profile
    • My Q&A
    • My Videos
    • Log Out

The Moz Q&A Forum

  • Forum
  • Questions
  • Users
  • Ask the Community

Welcome to the Q&A Forum

Browse the forum for helpful insights and fresh discussions about all things SEO.

  1. Home
  2. SEO Tactics
  3. Intermediate & Advanced SEO
  4. Google is indexing wordpress attachment pages

Moz Q&A is closed.

After more than 13 years, and tens of thousands of questions, Moz Q&A closed on 12th December 2024. Whilst we’re not completely removing the content - many posts will still be possible to view - we have locked both new posts and new replies. More details here.

Google is indexing wordpress attachment pages

Intermediate & Advanced SEO
9
18
18.2k
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as question
Log in to reply
This topic has been deleted. Only users with question management privileges can see it.
  • TauriU
    TauriU last edited by Feb 9, 2012, 1:36 PM

    Hey,

    I have a bit of a problem/issue what is freaking me out a bit. I hope you can help me. If i do site:www.somesitename.com search in Google i see that Google is indexing my attachment pages. I want to redirect attachment URL's to parent post and stop google from indexing them.

    I have used different redirect plugins in hope that i can fix it myself but plugins don't work. I get a error:"too many redirects occurred trying to open www.somesitename.com/?attachment_id=1982 ".

    Do i need to change something in my attachment.php fail? Any idea what is causing this problem?

    get_header(); ?>

    /* Run the loop to output the attachment. * If you want to overload this in a child theme then include a file * called loop-attachment.php and that will be used instead. */ get_template_part( 'loop', 'attachment' ); ?>

    1 Reply Last reply Reply Quote 0
    • David_ODonnell
      David_ODonnell last edited by May 14, 2013, 1:32 PM May 14, 2013, 1:32 PM

      This plugin automatically 301 redirects image attachment pages to the parent post, simply install and activate, done:

      http://wordpress.org/extend/plugins/attachment-pages-redirect/

      1 Reply Last reply Reply Quote 0
      • yeagerd
        yeagerd @Chad.Agrawal last edited by May 5, 2013, 10:13 AM May 5, 2013, 10:13 AM

        Just because you make it yourself and it doesn't install from the control panel.....  doesn't mean it is not a plugin.

        However, it is a very specialized plugin that will do the job without cluttering anything else up.

        Make sure you save a copy out to the side in case you loose it in updates.

        1 Reply Last reply Reply Quote 0
        • Chad.Agrawal
          Chad.Agrawal last edited by Jan 14, 2013, 1:24 PM Jan 14, 2013, 1:24 PM

          I found a great solution for this without using a plugin:

          http://www.lancelhoff.com/wordpress-disable-image-attachment-page-links/

          It works for me on my site 🙂

          Chad

          yeagerd 1 Reply Last reply May 5, 2013, 10:13 AM Reply Quote 0
          • RijoAbraham
            RijoAbraham last edited by Sep 16, 2012, 4:25 AM Sep 16, 2012, 3:45 AM

            Having same problem, i have so many duplicate pages (more than 350) and all them caused by wordpress attachments. All i can do as keri said link images to direct image url or dont link at all.

            Right now i'm going to remove all hyper-links from images. Easy way.

            No wait  i used this option in yoast plugin and it redirects attachments. I don't know why its not working for "TauriU "

            Tick: Redirect attachment URL's to parent post URL.

            1 Reply Last reply Reply Quote 0
            • KeriMorgret
              KeriMorgret @JohnTulley last edited by Aug 7, 2012, 1:45 PM Aug 7, 2012, 1:45 PM

              I insert the image via the image icon, then I put the link in as the URL of the image itself. There's a button that talks about which to link to, can't remember exactly what it's called, but look for that option in the link page.

              1 Reply Last reply Reply Quote 0
              • JohnTulley
                JohnTulley @KeriMorgret last edited by Aug 7, 2012, 7:45 AM Aug 7, 2012, 7:45 AM

                Hi Keri, I'm also having problems dozens of Wordpress attachment pages being indexed in google. When you say you link directly to the image do you mean that  when you add an image you use the add 'from URL' option?

                KeriMorgret 1 Reply Last reply Aug 7, 2012, 1:45 PM Reply Quote 0
                • KeriMorgret
                  KeriMorgret last edited by Feb 9, 2012, 3:21 PM Feb 9, 2012, 3:21 PM

                  What I have done on my wordpress site is to make sure I'm linking directly to the image and not to the attachment page. If someone clicks on the image, they get a nice large (2000 pixel wide) image by itself, no attachment page or anything. I don't know if that will work for you, but it does work in my case.

                  JohnTulley 1 Reply Last reply Aug 7, 2012, 7:45 AM Reply Quote 0
                  • TauriU
                    TauriU @TauriU last edited by Feb 16, 2012, 2:34 PM Feb 9, 2012, 3:17 PM

                    I wasn't able to figure out how this plugin works exactly:( lack of knowledge, on my part.

                    My site url is   if this is any help. And if you click here http://tinyurl.com/8x55yh8 you see what google site:domainname.com search bring out. All those attachment pages should redirect to parent post URL's.

                    i hope this is at least a bit helpful information

                    1 Reply Last reply Reply Quote 0
                    • ClickConsult
                      ClickConsult @TauriU last edited by Feb 9, 2012, 2:49 PM Feb 9, 2012, 2:49 PM

                      OK, do you happen to have Live HTTP Headers for FireFox (or any other tool/plug-in that'd be able to record all http headers) so you can see what exactly is happening with the redirects?

                      If so, could you again paste that over to pastebin.com?

                      1 Reply Last reply Reply Quote 0
                      • TauriU
                        TauriU @TauriU last edited by Feb 9, 2012, 2:44 PM Feb 9, 2012, 2:44 PM

                        I tried your suggestion, but it doesn't work unfortunately

                        i m using custom permalink structure. /%postname%

                        is there any possibility that issue lays in " /%postname% " structure.

                        1 Reply Last reply Reply Quote 0
                        • TauriU
                          TauriU @mad2k last edited by Feb 9, 2012, 2:31 PM Feb 9, 2012, 2:31 PM

                          i have already done lots of optimization in Yoast plugin:) don't want to change plugins now. but i try it out when nothing else doesn't work

                          1 Reply Last reply Reply Quote 0
                          • ClickConsult
                            ClickConsult @TauriU last edited by Feb 9, 2012, 2:29 PM Feb 9, 2012, 2:29 PM

                            OK, there's nothing strange with the htaccess.

                            I'd suggest that you now disable all of the plug-ins expect for Yoast's just so you can debug if the issue is due to any other plug-ins installed.

                            I know it sounds strange, but I'd also suggest that you go to the permalinks section of the WordPress admin and update the settings - don't change anything at the moment, just update. Sometimes that can reset any issues with the permalinks.

                            1 Reply Last reply Reply Quote 0
                            • TauriU
                              TauriU @TauriU last edited by Feb 9, 2012, 2:25 PM Feb 9, 2012, 2:24 PM

                              i posted my site .htaccess file to pastebin.com. ulr http://pastebin.com/cLVNNCkb

                              List of active plug-ins.

                              AdRotate

                              Better Tag Cloud

                              Cleanup Wordpress

                              Contact Form 7

                              Featured Page Widget

                              Flexi Pages Widget

                              Link Carousel

                              MailChimp Widget

                              WordPress Importer

                              WordPress SEO by Yoast's

                              WP-Table Reloaded

                              WP SlimStat

                              WP SlimStat ShortCodes

                              I hope it help:) those freaking attachment pages are messing up my rankings:)

                              1 Reply Last reply Reply Quote 0
                              • mad2k
                                mad2k last edited by Feb 9, 2012, 2:09 PM Feb 9, 2012, 2:09 PM

                                For more than 2 months I'd been tested another SEO plugin - SEO Ultimate. IMHO it is the best plugin for WP at the time. It is very flexible and it is possible to decide about almost every element of a page. It has follow/nofollow and index/noindex manager and tons of other features.

                                SEO Ultimate

                                I don't have attachment pages indexed 🙂

                                TauriU 1 Reply Last reply Feb 9, 2012, 2:31 PM Reply Quote 0
                                • ClickConsult
                                  ClickConsult @TauriU last edited by Feb 9, 2012, 1:59 PM Feb 9, 2012, 1:59 PM

                                  Hmm, that's pretty strange. It sounds like you could have an issue with your htaccess file.

                                  Could you paste your .htaccess file to pastebin.com?

                                  You also said that you've attempted to use a few different plug-ins to achieve this - I'd suggest that you double check that the other plug-ins aren't active. Would you be able to send over a list of the plug-ins that are active too, in addition to the .htaccess file contents?

                                  1 Reply Last reply Reply Quote 0
                                  • TauriU
                                    TauriU @ClickConsult last edited by Feb 9, 2012, 1:55 PM Feb 9, 2012, 1:55 PM

                                    Thank you for a quick answer.

                                    Yoast's SEO plug-in is my main SEO plugin. I have tried option in the plugin that should Redirect attachment URL's to parent post URL's.  Unfortunately it doesn't work.

                                    I get a error: "too many redirects occurred trying to open www.somesitename.com/?attachment_id=1982 ".

                                    ClickConsult TauriU 6 Replies Last reply Feb 9, 2012, 3:17 PM Reply Quote 0
                                    • ClickConsult
                                      ClickConsult last edited by Feb 9, 2012, 1:42 PM Feb 9, 2012, 1:42 PM

                                      Hi there,

                                      This is common with WordPress, attatchments by default have their own pages.

                                      Have you heard of Yoast's SEO plug-in before?

                                      http://yoast.com/wordpress/seo/

                                      I'd recommend that you install Yoast's SEO plug-in, it has the ability to redirect attachment pages back to the main page which is what you're trying to achieve.

                                      If you do use Yoast's SEO plug-in, let me know how you get on.

                                      Good luck!

                                      TauriU 1 Reply Last reply Feb 9, 2012, 1:55 PM Reply Quote 0
                                      • 1 / 1
                                      1 out of 18
                                      • First post
                                        1/18
                                        Last post

                                      Got a burning SEO question?

                                      Subscribe to Moz Pro to gain full access to Q&A, answer questions, and ask your own.


                                      Start my free trial


                                      Browse Questions

                                      Explore more categories

                                      • Moz Tools

                                        Chat with the community about the Moz tools.

                                      • SEO Tactics

                                        Discuss the SEO process with fellow marketers

                                      • Community

                                        Discuss industry events, jobs, and news!

                                      • Digital Marketing

                                        Chat about tactics outside of SEO

                                      • Research & Trends

                                        Dive into research and trends in the search industry.

                                      • Support

                                        Connect on product support and feature requests.

                                      • See all categories

                                      Related Questions

                                      • chelseaskirtinguk

                                        My product category pages are not being indexed on google can someone help?

                                        My website has been indexed on google and all of its pages can be found on google except for the product category pages - which are where we want our traffic heading to, so this is a big problem for us. Our website is www.skirtinguk.com And an example of a page that isn't being indexed is https://www.skirtinguk.com/product-category/mdf-skirting-board/

                                        Intermediate & Advanced SEO | Jul 1, 2022, 1:09 PM | chelseaskirtinguk
                                        0
                                      • SEO1805

                                        Google Indexing Request - Typical Time to Complete?

                                        In Google Search Console, when you request the (re) indexing of a fetched page, what's the average amount of time it takes to re-index and does it vary that much from site to site or are manual re-index request put in a queue and served on a first come - first serve basis despite the site characteristics like domain/page authority?

                                        Intermediate & Advanced SEO | May 16, 2018, 12:41 PM | SEO1805
                                        0
                                      • Ben-R

                                        E-Commerce Site Collection Pages Not Being Indexed

                                        Hello Everyone, So this is not really my strong suit but I’m going to do my best to explain the full scope of the issue and really hope someone has any insight. We have an e-commerce client (can't really share the domain) that uses Shopify; they have a large number of products categorized by Collections. The issue is when we do a site:search of our Collection Pages (site:Domain.com/Collections/) they don’t seem to be indexed. Also, not sure if it’s relevant but we also recently did an over-hall of our design. Because we haven’t been able to identify the issue here’s everything we know/have done so far: Moz Crawl Check and the Collection Pages came up. Checked Organic Landing Page Analytics (source/medium: Google) and the pages are getting traffic. Submitted the pages to Google Search Console. The URLs are listed on the sitemap.xml but when we tried to submit the Collections sitemap.xml to Google Search Console 99 were submitted but nothing came back as being indexed (like our other pages and products). We tested the URL in GSC’s robots.txt tester and it came up as being “allowed” but just in case below is the language used in our robots:
                                        User-agent: *
                                        Disallow: /admin
                                        Disallow: /cart
                                        Disallow: /orders
                                        Disallow: /checkout
                                        Disallow: /9545580/checkouts
                                        Disallow: /carts
                                        Disallow: /account
                                        Disallow: /collections/+
                                        Disallow: /collections/%2B
                                        Disallow: /collections/%2b
                                        Disallow: /blogs/+
                                        Disallow: /blogs/%2B
                                        Disallow: /blogs/%2b
                                        Disallow: /design_theme_id
                                        Disallow: /preview_theme_id
                                        Disallow: /preview_script_id
                                        Disallow: /apple-app-site-association
                                        Sitemap: https://domain.com/sitemap.xml A Google Cache:Search currently shows a collections/all page we have up that lists all of our products. Please let us know if there’s any other details we could provide that might help. Any insight or suggestions would be very much appreciated. Looking forward to hearing all of your thoughts! Thank you in advance. Best,

                                        Intermediate & Advanced SEO | May 22, 2017, 6:39 AM | Ben-R
                                        0
                                      • friendoffood

                                        Pages are Indexed but not Cached by Google. Why?

                                        Here's an example: I get a 404 error for this: http://webcache.googleusercontent.com/search?q=cache:http://www.qjamba.com/restaurants-coupons/ferguson/mo/all But a search for qjamba restaurant coupons gives a clear result as does this: site:http://www.qjamba.com/restaurants-coupons/ferguson/mo/all What is going on?  How can this page be indexed but not in the Google cache? I should make clear that the page is not showing up with any kind of error in webmaster tools, and Google has been crawling pages just fine.  This particular page was fetched by Google yesterday with no problems, and even crawled again twice today by Google  Yet, no cache.

                                        Intermediate & Advanced SEO | Jan 30, 2015, 12:55 PM | friendoffood
                                        2
                                      • edlondon

                                        Google Not Indexing XML Sitemap Images

                                        Hi Mozzers, We are having an issue with our XML sitemap images not being indexed. The site has over 39,000 pages and 17,500 images submitted in GWT.  If you take a look at the attached screenshot, 'GWT Images - Not Indexed', you can see that the majority of the pages are being indexed - but none of the images are. The first thing you should know about the images is that they are hosted on a content delivery network (CDN), rather than on the site itself. However, Google advice suggests hosting on a CDN is fine - see second screenshot, 'Google CDN Advice'.  That advice says to either (i) ensure the hosting site is verified in GWT or (ii) submit in robots.txt.  As we can't verify the hosting site in GWT, we had opted to submit via robots.txt. There are 3 sitemap indexes: 1) http://www.greenplantswap.co.uk/sitemap_index.xml, 2) http://www.greenplantswap.co.uk/sitemap/plant_genera/listings.xml and 3) http://www.greenplantswap.co.uk/sitemap/plant_genera/plants.xml. Each sitemap index is split up into often hundreds or thousands of smaller XML sitemaps. This is necessary due to the size of the site and how we have decided to pull URLs in.  Essentially, if we did it another way, it may have involved some of the sitemaps being massive and thus taking upwards of a minute to load. To give you an idea of what is being submitted to Google in one of the sitemaps, please see view-source:http://www.greenplantswap.co.uk/sitemap/plant_genera/4/listings.xml?page=1. Originally, the images were SSL, so we decided to reverted to non-SSL URLs as that was an easy change.  But over a week later, that seems to have had no impact.  The image URLs are ugly... but should this prevent them from being indexed? The strange thing is that a very small number of images have been indexed - see http://goo.gl/P8GMn. I don't know if this is an anomaly or whether it suggests no issue with how the images have been set up - thus, there may be another issue. Sorry for the long message but I would be extremely grateful for any insight into this.  I have tried to offer as much information as I can, however please do let me know if this is not enough. Thank you for taking the time to read and help. Regards, Mark Oz6HzKO rYD3ICZ

                                        Intermediate & Advanced SEO | Feb 19, 2014, 8:51 AM | edlondon
                                        0
                                      • sbrault74

                                        Google Indexing Feedburner Links???

                                        I just noticed that for lots of the articles on my website, there are two results in Google's index. For instance: http://www.thewebhostinghero.com/articles/tools-for-creating-wordpress-plugins.html and http://www.thewebhostinghero.com/articles/tools-for-creating-wordpress-plugins.html?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+thewebhostinghero+(TheWebHostingHero.com) Now my Feedburner feed is set to "noindex" and it's always been that way. The canonical tag on the webpage is set to: rel='canonical' href='http://www.thewebhostinghero.com/articles/tools-for-creating-wordpress-plugins.html' /> The robots tag is set to: name="robots" content="index,follow,noodp" /> I found out that there are scrapper sites that are linking to my content using the Feedburner link. So should the robots tag be set to "noindex" when the requested URL is different from the canonical URL? If so, is there an easy way to do this in Wordpress?

                                        Intermediate & Advanced SEO | Jun 14, 2013, 9:44 AM | sbrault74
                                        0
                                      • HrThomsen

                                        Best practice for removing indexed internal search pages from Google?

                                        Hi Mozzers I know that it’s best practice to block Google from indexing internal search pages, but what’s best practice when “the damage is done”? I have a project where a substantial part of our visitors and income lands on an internal search page, because Google has indexed them (about 3 %). I would like to block Google from indexing the search pages via the meta noindex,follow tag because: Google Guidelines: “Use robots.txt to prevent crawling of search results pages or other auto-generated pages that don't add much value for users coming from search engines.” http://support.google.com/webmasters/bin/answer.py?hl=en&answer=35769 Bad user experience The search pages are (probably) stealing rankings from our real landing pages Webmaster Notification: “Googlebot found an extremely high number of URLs on your site” with links to our internal search results I want to use the meta tag to keep the link juice flowing. Do you recommend using the robots.txt instead? If yes, why? Should we just go dark on the internal search pages, or how shall we proceed with blocking them? I’m looking forward to your answer! Edit: Google have currently indexed several million of our internal search pages.

                                        Intermediate & Advanced SEO | Feb 10, 2016, 6:49 AM | HrThomsen
                                        0
                                      • Peter264

                                        NOINDEX listing pages: Page 2, Page 3... etc?

                                        Would it be beneficial to NOINDEX category listing pages except for the first page.  For example on this site: http://flyawaysimulation.com/downloads/101/fsx-missions/ Has lots of pages such as Page 2, Page 3, Page 4... etc: http://www.google.com/search?q=site%3Aflyawaysimulation.com+fsx+missions Would there be any SEO benefit of NOINDEX on these pages?  Of course, FOLLOW is default, so links would still be followed and juice applied. Your thoughts and suggestions are much appreciated.

                                        Intermediate & Advanced SEO | Dec 6, 2011, 3:18 PM | Peter264
                                        0

                                      Get started with Moz Pro!

                                      Unlock the power of advanced SEO tools and data-driven insights.

                                      Start my free trial
                                      Products
                                      • Moz Pro
                                      • Moz Local
                                      • Moz API
                                      • Moz Data
                                      • STAT
                                      • Product Updates
                                      Moz Solutions
                                      • SMB Solutions
                                      • Agency Solutions
                                      • Enterprise Solutions
                                      Free SEO Tools
                                      • Domain Authority Checker
                                      • Link Explorer
                                      • Keyword Explorer
                                      • Competitive Research
                                      • Brand Authority Checker
                                      • Local Citation Checker
                                      • MozBar Extension
                                      • MozCast
                                      Resources
                                      • Blog
                                      • SEO Learning Center
                                      • Help Hub
                                      • Beginner's Guide to SEO
                                      • How-to Guides
                                      • Moz Academy
                                      • API Docs
                                      About Moz
                                      • About
                                      • Team
                                      • Careers
                                      • Contact
                                      Why Moz
                                      • Case Studies
                                      • Testimonials
                                      Get Involved
                                      • Become an Affiliate
                                      • MozCon
                                      • Webinars
                                      • Practical Marketer Series
                                      • MozPod
                                      Connect with us

                                      Contact the Help team

                                      Join our newsletter
                                      Moz logo
                                      © 2021 - 2025 SEOMoz, Inc., a Ziff Davis company. All rights reserved. Moz is a registered trademark of SEOMoz, Inc.
                                      • Accessibility
                                      • Terms of Use
                                      • Privacy

                                      Looks like your connection to Moz was lost, please wait while we try to reconnect.