Are you worried about those strange search results that you came across recently upon searching “site:yoursitename” on google ? What makes you worried is when you click on those results , you end up opening only an image in a blank page without any actual content. Look image below how those results look like in SERP-
The above search result opens only an image in a blank page without any other content(text). “make a pendrive bootable using cmd 1” is actually the name of an image from this post. Such pages are called image attachment pages which add no value to search engine .
Image attachment pages affect SEO badly. Visitors hitting blank pages with no actual content will increase bounce rate of your website. Google don’t like unnecessary pages as they don’t have any value to visitors. So its better to stop those all unnecessary pages to be crawled and indexed.
WordPress Image Attachment Pages
When you write a post , add an image to it and hit publish button, the WordPress generates 2 different URL’s –
- One for the post – lets say URL for the post is yoursitename.com/post-title (depending upon the permalink structure of your site)
- Second for the image you added – the structure of URL will be yoursitename.com/post-title/nameoftheimage. These types of pages hold only an image in it and called image attachment pages. See demonstration below –
Similarly when you add 5 images to a post, wordpress creates 6 links – 1 for the post(redirect you to the original post) and 5 for the images(redirect you to 5 different standalone pages containing only an image). Upon checking the source code of an image attachment page, you will find that it has a “no index” meta tag which allows it to be exposed to google bots and it get indexed.
How to Stop Google Indexing Image Attachment Pages ?
There are multiple ways to prevent google indexing image attachment pages. One simplest and preferred method is to do it by popular plugin Yoast WordPress SEO –
- Install Yoast WordPress SEO plugin (see guide how to install a plugin)
- After install go to SEO>>Permalinks from the WordPress dashboard.
- Check the box – “Redirect attachment URL’s to parent post URL”. and save settings.
Once you have done this , whenever someone click on the image attachment page , he will be redirected to the parent/original post. This setting apply 301 permanent redirect which send a message to google bots that “the page has been moved to a new address” and they can remove it to avoid duplication.
Alternative – If you are not comfortable with Yoast SEO plugin then install another dedicated plugin( Noindex Attachment Pages) which is made for only applying No-Index tag to attachment pages.
What’s next – Don’t think by doing this , all the indexed image attachment pages will be disappear suddenly from the SERP. An indexed page may take a couple of days to months to get removed. The reason for this is that a website owner might select wrong settings accidentally and all important posts/pages will be removed instantly. This is why Google takes time to remove indexed posts/pages. So wait patiently till Google removes all indexed image attachment pages.