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.

      What is your Brand Authority?
      Moz

      What is your Brand Authority?

      Check yours now
    • 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.

      • SEO Q&A

        Insights & discussions from an SEO community of 500,000+.

      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
    18237
    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

      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

        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

          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

            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 Reply Quote 0
            • RijoAbraham
              RijoAbraham last edited by

              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

                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

                  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 Reply Quote 0
                  • KeriMorgret
                    KeriMorgret last edited by

                    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 Reply Quote 0
                    • TauriU
                      TauriU @TauriU last edited by

                      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

                        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

                          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

                            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

                              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

                                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

                                  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 Reply Quote 0
                                  • ClickConsult
                                    ClickConsult @TauriU last edited by

                                    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

                                      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 Reply Quote 0
                                      • ClickConsult
                                        ClickConsult last edited by

                                        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 Reply Quote 0
                                        • 1 / 1
                                        • First post
                                          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

                                        • Mat_C

                                          How do internal search results get indexed by Google?

                                          Hi all, Most of the URLs that are created by using the internal search function of a website/web shop shouldn't be indexed since they create duplicate content or waste crawl budget. The standard way to go is to 'noindex, follow' these pages or sometimes to use robots.txt to disallow crawling of these pages. The first question I have is how these pages actually would get indexed in the first place if you wouldn't use one of the options above. Crawlers follow links to index a website's pages. If a random visitor comes to your site and uses the search function, this creates a URL. There are no links leading to this URL, it is not in a sitemap, it can't be found through navigating on the website,... so how can search engines index these URLs that were generated by using an internal search function? Second question: let's say somebody embeds a link on his website pointing to a URL from your website that was created by an internal search. Now let's assume you used robots.txt to make sure these URLs weren't indexed. This means Google won't even crawl those pages. Is it possible then that the link that was used on another website will show an empty page after a while, since Google doesn't even crawl this page? Thanks for your thoughts guys.

                                          Intermediate & Advanced SEO | | Mat_C
                                          0
                                        • Bryggselv.no

                                          How can I make a list of all URLs indexed by Google?

                                          I started working for this eCommerce site 2 months ago, and my SEO site audit revealed a massive spider trap. The site should have been 3500-ish pages, but Google has over 30K pages in its index. I'm trying to find a effective way of making a list of all URLs indexed by Google. Anyone? (I basically want to build a sitemap with all the indexed spider trap URLs, then set up 301 on those, then ping Google with the "defective" sitemap so they can see what the site really looks like and remove those URLs, shrinking the site back to around 3500 pages)

                                          Intermediate & Advanced SEO | | Bryggselv.no
                                          0
                                        • MichaelWhyley

                                          Newly designed page ranks in Google but then disappears - at a loss as to why.

                                          Hi all, I wondered if you could help me at all please? We run a site called getinspired365.com (which is not optimised) and in the last 2 weeks have tried to optimise some new pages that we have added. For example, we have optimised this page - http://getinspired365.com/lifes-a-bit-like-mountaineering-never-look-down This page was added to Google's index via webmaster tools. When I then did a search for the full quote it came back 2nd in Google's search. If I did a search for half the quote (Life is a bit like mountaineering) it also ranked 2nd. We had another quote page that we'd optimised that displayed similar behaviour (it ranked 4th). But then for some reason when I now do the search it doesn't rank in the top 100 results. This, despite, an unoptimised "normal" page ranking 4th for a search such as: Thousands of geniuses live and die undiscovered. So our domain doesn't seem to be penalised as our "normal" pages are ranking. These pages aren't particularly well designed from an SEO standpoint. But our new pages - which are optimised - keep disappearing from Google, despite the fact they still show as indexed. I've rendered the pages and everything appears fine within Google Webmaster Tools. At a bit of a loss as to why they'd drop so significantly? A few pages I could understand but they've all but been removed. Any one seen this before, and any ideas what could be causing the issue? We have a different URL structure for our new pages in that we have the quote appear in the URL. All the content (bar the quote) that you see in the new pages are unique content that we've written ourselves. Could it be that we've over optimised and Google view these pages as spam? Many thanks in advance for all your help.

                                          Intermediate & Advanced SEO | | MichaelWhyley
                                          0
                                        • TextStylesUK

                                          Page position dropped on Google

                                          Hey Guys, My web designer has recommended this forum to use, the reason being: my google position has been dropped from page 1 to page 10 in the last week. The site is weloveschoolsigns.co.uk, but our main business site is textstyles.co.uk the school signs are a product of text styles. I have been told off my SEO company, that because I have changed the school logo to the text styles logo, Google have penalised me for it, and dropped us from page 1 for numerous keywords, to page 10 or more. They have also said that duplicate content within the school site  http://www.weloveschoolsigns.co.uk/school-signs-made-easy/ has also a contributed to the drop in positions. (this content is not on the textstyles site) Lastly they said, that having the same telephone number is a definate no no. They said that I have been penalised, because google see the above as trying to monopolise on the market. I don’t know if all this is true, as the SEO is way above my head, but they have quoted me £1250 to repair all the errors, when the site only cost £750. They have also mentioned that because of the above changes, the main text styles site will also be punished. Any thoughts on this matter would be much appreciated as I don't know whether to pay them to crack on, or accept the new positions. Either way I'm very confused. Thanks Thomas

                                          Intermediate & Advanced SEO | | TextStylesUK
                                          0
                                        • KateV

                                          Does Google hate wordpress?

                                          I have my categories pages set to noindex, follow. I deactivated the author and date based archives, and all the /page/2 /page/3 are noindex. Is this the right approach? I had thought about adding some text to the topic of each category page and then changing them to index. I'm using showing recent post excerpts on the homepage. Another other suggestions? I think two of my sites are in panda for no good reason. It seems like non-wordpress blogs in my industry do better than comparable wordpress sites.

                                          Intermediate & Advanced SEO | | KateV
                                          0
                                        • WebbyNabler

                                          Duplicate Content From Indexing of non- File Extension Page

                                          Google somehow has indexed a page of mine without the .html extension.  so they indexed  www.samplepage.com/page, so I am showing duplicate content because Google also see's  www.samplepage.com/page.html   How can I force google or bing or whoever to only index and see the page including the .html extension?  I know people are saying not to use the file extension on pages, but I want to, so please anybody...HELP!!!

                                          Intermediate & Advanced SEO | | WebbyNabler
                                          0
                                        • richardo24hr

                                          Best possible linking on site with 100K indexed pages

                                          Hello All, First of all I would like to thank everybody here for sharing such great knowledge with such amazing and heartfelt passion.It really is good to see. Thank you. My story / question: I recently sold a site with more than 100k pages indexed in Google. I was allowed to keep links on the site.These links being actual anchor text links on both the home page as well on the 100k news articles. On top of that, my site syndicates its rss feed (Just links and titles, no content) to this page. However, the new owner made a mess, and now the site could possibly be seen as bad linking to my site. Google tells me within webmasters that this particular site gives me more than 400K backlinks. I have NEVER received one single notice from Google that I have bad links. That first. But, I was worried that this page could have been the reason why MY site tanked as bad as it did. It's the only source linking so massive to me. Just a few days ago, I got in contact with the new site owner. And he has taken my offer to help him 'better' his site. Although getting the site up to date for him is my main purpose, since I am there, I will also put effort in to optimizing the links back to my site. My question: What would be the best to do for my 'most SEO gain' out of this? The site is a news paper type of site, catering for news within the exact niche my site is trying to rank. Difference being, his is a news site, mine is not. It is commercial. Once I fix his site, there will be regular news updates all within the niche we both are in. Regularly as in several times per day. It's news. In the niche. Should I leave my rss feed in the side bars of all the content? Should I leave an achor text link on the sidebar (on all news etc.) If so: there can be just one keyword... 407K pages linking with just 1 kw?? Should I keep it to just one link on the home page? I would love to hear what you guys think. (My domain is from 2001. Like a quality wine. However, still tanked like a submarine.) ALL SEO reports I got here are now Grade A. The site is finally fully optimized. Truly nice to have that confirmation. Now I hope someone will be able to tell me what is best to do, in order to get the most SEO gain out of this for my site. Thank you.

                                          Intermediate & Advanced SEO | | richardo24hr
                                          0
                                        • alextanner

                                          Duplicate page titles Wordpress SEO/Yoast

                                          Hi I have a Wordpress site using the Wordpress SEO plugin by Yoast. Everything appears to be fine except that on 1 Feb SEOMoz crawl suddenly picked up a bunch of errors. The errors are duplicate page titles, and these exist only for the mysite.com/page/X pages. I can't find any setting in Yoast that looks wrong or tells me how to fix this. The pages are also dynamically canonicalizing to themselves - not sure if this makes any difference although I don't know how this is happening. Does anyone know how to fix this duplicate title error? Alex

                                          Intermediate & Advanced SEO | | alextanner
                                          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
                                        • 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.