Take a look at the following URL: http:// www.samuel-berthelot.com / ? attachment_id=703

There is a link to the next image that reads lumière sur la mariéat the bottom of the image. It redirects to attachment with id 704.

I have set a permanent redirection to attachment with id 1743 because they were both showing the same image that I had uploaded twice at different points in time.

So it works fine, except that I would like to change the link to open the attachment with id 1743. This way I wouldn't have a 404 warning in Google Webmaster Tools.

How can I do that with Wordpress ? I don't know how this links are generated.

  • so you want to set another image at attachment with id 1743 link? – Helping Hands May 28 '15 at 10:06
  • 1
    If you go to phpmyadmin, you select wordpress database, then "suffix"_posts table, you can change manually the id of your attachments. Is that what you want? Maybe that's the answer. – lucgenti May 28 '15 at 10:53
  • 1
    What I mean is that the link should redirect to the new attachment, even though I set up a 301. This would be cleaner. So I can change that directly in the database ? What would be the query ? I doubt it is in the _posts table, is it ? – Sam May 28 '15 at 13:15
  • I'll write you an aswer. – lucgenti May 28 '15 at 14:25
  • No wait, there's something that I don't understand. Why are you having 404 errors? If you have a working 301 redirection webmaster tools shouldn't tell you anything about 404. – lucgenti May 28 '15 at 14:44

Your Answer

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

Browse other questions tagged or ask your own question.