Should WordPress attachment pages redirect to the image file or to the parent post?

Was this question useful?Community ranking

Answers

1 answer

Usually redirect the attachment-page URL to its live parent post, not the image file. The parent post gives visitors the image in context, and Google says the content and metadata of the page where an image is embedded can affect how it appears in image search. Keep the direct `/uploads/...` image URL working, though—WordPress treats a media-file link and an attachment-page link as separate choices. For an orphaned attachment, don’t send people to the homepage or some unrelated post just to avoid a 404; use a redirect only when there’s a clear equivalent destination. Also test what your site actually does before adding a rule. On new WordPress installs, front-end attachment pages have been disabled by default since WordPress 6.4, so a theme or plugin may be what’s making them available in the first place.

Was this answer helpful?Community ranking

Your answer

Sign in to answer.

Keep exploring

Similar questions

Browse all