4

I've noticed that when I attach an image to a post, two URLs are generated, not just one:

http://www.example.com/?attachment_id=1782

http://www.example.com/blog/2014/09/26/some-article/attachment/the-title-of-the-image/

This leads to duplicate titles in Google Webmaster Tool.

I'm in the process of creating 301 redirects to avoid this but it is painful.

Is it normal behaviour of Wordpress ?

  • There may be a setting somewhere in WP for you to help clean up some of this stuff. I do not know WP at all, but I would prefer that you have a fix to the problem rather than doing redirects which really should be avoided when possible. – closetnoc May 26 '15 at 15:43
2

I would use Yoast's SEO plugin to fix this. There is a setting which will redirect image attachments to the parent post. All done for you so no need to do anything manually. Go under Advanced, click Permalinks tab and check the second option:

enter image description here

or you can just setup something in .htaccess file to do the same.

| improve this answer | |

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.