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
- 
					
					
					
					
 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' ); ?> 
- 
					
					
					
					
 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/ 
- 
					
					
					
					
 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. 
- 
					
					
					
					
 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 
- 
					
					
					
					
 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. 
- 
					
					
					
					
 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. 
- 
					
					
					
					
 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? 
- 
					
					
					
					
 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. 
- 
					
					
					
					
 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 
- 
					
					
					
					
 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? 
- 
					
					
					
					
 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. 
- 
					
					
					
					
 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 
- 
					
					
					
					
 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. 
- 
					
					
					
					
 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:) 
- 
					
					
					
					
 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. I don't have attachment pages indexed  
- 
					
					
					
					
 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? 
- 
					
					
					
					
 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 ". 
- 
					
					
					
					
 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! 
Browse Questions
Explore more categories
- 
		
		Moz ToolsChat with the community about the Moz tools. 
- 
		
		SEO TacticsDiscuss the SEO process with fellow marketers 
- 
		
		CommunityDiscuss industry events, jobs, and news! 
- 
		
		Digital MarketingChat about tactics outside of SEO 
- 
		
		Research & TrendsDive into research and trends in the search industry. 
- 
		
		SupportConnect on product support and feature requests. 
Related Questions
- 
		
		
		
		
		
		Staging website got indexed by google
 Our staging website got indexed by google and now MOZ is showing all inbound links from staging site, how should i remove those links and make it no index. Note- we already added Meta NOINDEX in head tag Intermediate & Advanced SEO | | Asmi-Ta0
- 
		
		
		
		
		
		Google Is Indexing my 301 Redirects to Other sites
 Long story but now i have a few links from my site 301 redirecting to youtube videos or eCommerce stores. They carry a considerable amount of traffic that i benefit from so i can't take them down, and that traffic is people from other websites, so basically i have backlinks from places that i don't own, to my redirect urls (Ex. http://example.com/redirect) My problem is that google is indexing them and doesn't let them go, i have tried blocking that url from robots.txt but google is still indexing it uncrawled, i have also tried allowing google to crawl it and adding noindex from robots.txt, i have tried removing it from GWT but it pops back again after a few days. Any ideas? Thanks! Intermediate & Advanced SEO | | cuarto7150
- 
		
		
		
		
		
		Google does not want to index my page
 I have a site that is hundreds of page indexed on Google. But there is a page that I put in the footer section that Google seems does not like and are not indexing that page. I've tried submitting it to their index through google webmaster and it will appear on Google index but then after a few days it's gone again. Before that page had canonical meta to another page, but it is removed now. Intermediate & Advanced SEO | | odihost0
- 
		
		
		
		
		
		How do you check the google cache for hashbang pages?
 So we use http://webcache.googleusercontent.com/search?q=cache:x.com/#!/hashbangpage to check what googlebot has cached but when we try to use this method for hashbang pages, we get the x.com's cache... not x.com/#!/hashbangpage That actually makes sense because the hashbang is part of the homepage in that case so I get why the cache returns back the homepage. My question is - how can you actually look up the cache for hashbang page? Intermediate & Advanced SEO | | navidash0
- 
		
		
		
		
		
		No-index pages with duplicate content?
 Hello, I have an e-commerce website selling about 20 000 different products. For the most used of those products, I created unique high quality content. The content has been written by a professional player that describes how and why those are useful which is of huge interest to buyers. It would cost too much to write that high quality content for 20 000 different products, but we still have to sell them. Therefore, our idea was to no-index the products that only have the same copy-paste descriptions all other websites have. Do you think it's better to do that or to just let everything indexed normally since we might get search traffic from those pages? Thanks a lot for your help! Intermediate & Advanced SEO | | EndeR-0
- 
		
		
		
		
		
		Why are bit.ly links being indexed and ranked by Google?
 I did a quick search for "site:bit.ly" and it returns more than 10 million results. Given that bit.ly links are 301 redirects, why are they being indexed in Google and ranked according to their destination? I'm working on a similar project to bit.ly and I want to make sure I don't run into the same problem. Intermediate & Advanced SEO | | JDatSB1
- 
		
		
		
		
		
		Wordpress blog in a subdirectory not being indexed by Google
 HI MozzersIn my websites sitemap.xml, pages are listed, such as /blog/ and /blog/textile-fact-or-fiction-egyptian-cotton-explained/These pages are visible when you visit them in a browser and when you use the Google Webmaster tool - Fetch as Google to view them (see attachment), however they aren't being indexed in Google, not even the root directory for the blog (/blog/) is being indexed, and when we query:site: www.hilden.co.uk/blog/ It returns 0 results in Google.Also note that:The Wordpress installation is located at /blog/ which is a subdirectory of the main root directory which is managed by Magento. I'm wondering if this causing the problem.Any help on this would be greatly appreciated!AnthonyToTOHuj.png?1 Intermediate & Advanced SEO | | Tone_Agency0
- 
		
		
		
		
		
		Should I Allow Blog Tag Pages to be Indexed?
 I have a wordpress blog with settings currently set so that Google does not index tag pages. Is this a best practice that avoids duplicate content or am I hurting the site by taking eligible pages out of the index? Intermediate & Advanced SEO | | JSOC0
 
			
		 
			
		 
			
		 
			
		 
			
		 
			
		 
			
		 
			
		 
			
		 
					
				 
					
				 
					
				 
					
				 
					
				 
					
				 
					
				