WordPress – How to Change Image Attachments Default Link

by Ajay Singh, Apr 28, 2013 1 Comment

If you are SEO and pay special attention to image attachments in your WordPress blog then I’m sure that you would agree to link the images to attachments page instead of actual image itself. Linking images to attachment page gives you extra page per image which you can optimize further to bring additional traffic.

If you have a blog which has some awesome images such as recipe blog, movie blog or celebrity blog then you must link attached images to the attachment page.

By default WordPress links the attached image to media file (actual image file) as shown in the image below.

WordPress Image Attachments Default Link Settings

WordPress Image Attachments Default Link Settings

So how do you change the default link to attachment page?

you can do it by using the hidden options settings.

You can access this hidden options page from /wp-admin/options.php append this url after your blog name.

On this page you will see various advanced settings which with key-value pair. Don’t mess up with the settings unless you know what you are doing. There is a reason why this is a hidden page.

Search for image_default_link_type on this page. By default it is set to file which links attached image to the file (actual image).

WordPress image_default_link_type


Change it to post to link attachments to the attachment page.

Don’t forget to save the changes (scroll down at the bottom).

The 3rd option is to leave this value to be empty which also links the images to attachment page.


One Response to “ WordPress – How to Change Image Attachments Default Link ”
  1. Jane

    I was always wondering how to do it. I tried your method and it worked like a charm.

Leave a Reply

You must be logged in to post a comment.