How to redirect image URL to its post URL in wordpress

In wordpress, each image is stored as a post in database and a URL is assigned to it. When someone finds an image in the search results and clicks on it, then only the image opens in a browser window; not the post which has that image. It affects your image SEO traffic because search engines could redirect users to the link used for the image instead of your post.

So, you need to redirect image URL to its parent URL to improve SEO traffic to your site. In WordPress, if you have installed Yoast wordpress SEO plugin, follow the below steps.

Redirect image URL to its post URL using Yoast SEO

1. Goto SEO -> permalinks

2. Under Permalink settings, you will see “Redirect attachment URL’s to parent post URL” option

3. Check it and click “Save changes” button.

redirect image URL to post URL option in wordpress Yoast SEO

That’s it. From now onwards, image links will be redirected to their post URL.

Note: The above option works not only for images but also for any attachment in the post.

About the Author

SRINI S

A passionate blogger. Love to share solutions and best practices on wordpress hosting, issues and fixes, excel VBA macros and other apps