0

I'm helping my friend with his WordPress website and recently we noticed that in google search, some images appear as page/post. Also when clicked they seem to be reached in a page. I don't know what causes this. Need help immediately.

Thanks in advance.

appearance in google search Reachable as page

0

This is because your attachment pages are being indexed by Google.

A simple fix would be to install the WordPress SEO plugin and use it to redirect the attachment page URLs to the original media (your images).

After you install the plugin, go to "Search Appearance", then click the "Media" tab, and toggle the "Redirect attachment URLs to the attachment itself?" to "yes".

You can read the full details in this Yoast Article or in this Knowledge Base Article.

  • Thx, i did it but will it avoid google from indexing those attachment pages? – orhan7 Oct 22 at 9:55
  • Or is this option better: adding <?php wp_redirect(get_permalink($post->post_parent)); ?> to image.php – orhan7 Oct 22 at 10:01
  • There's no SEO value in those pages I don't think (You can always ask on the Webmaster Stack Exchange) so you're fine to just have them redirect to the images and leave it as that. – Alexander Holsgrove Oct 22 at 10:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.