When selecting a media from your WordPress Media Library, by default the Link URL selected, is the File URL. Now this may not be ideal if all the images you upload are not going to link to the file, and instead are just images to upload.
Luckily we can change the functionality, but the ability to change the default Link URL is not exposed to the user.
The option specifying the default link type is stored in the WordPress options as “image_default_link_type“. You can access the hidden WordPress options via visiting http://example.com/wp-admin/options.php (where example.com/ represents the url and path to your blog).
After accessing the page, search for “image_default_link_type” (its in alphabetical order). By default it should say “file“.
This field has a few options:
- blank (Yes literally nothing, or I just use “
none“) file– Use the File URL, ie: http://example.com/wp-content/2010/04/example.pngpost– Use the Post URL, ie: http://example.com/?attachment=1
Change the value to “none”. Do not touch the other options. Once you are done, save the changes by scrolling to the bottom, and hitting “Save Changes”.
There you have it, your WordPress default media Link URL has been changed.
Links and Resources
- WordPress.org Option Reference – Lists down all the available WordPress options



Pingback: Vkládání galerie do příspěvku « Fórum podpory WordPressu
brilliant. had never seen the “hidden” options form before. thanks!
Thank you so much,
You saved me a lot of trouble!
You look for this topic
Thank you
This is great. Thank you! You save so many clicks and tears :p
It Works!!! Thanks mate.
great, you saved my time. thanks
Brilliant. I’ve been searching for how to do this for a while, and this is exactly what I was looking for. Thanks so much.
very nicedoc to pdf conversion software i am useing this one thanks
Some people seem not to understand here….you have to navigate to http://example.com/wp-admin/options.php (where example.com/ represents the url and path to your blog) in your browser. You don’t need to open and edit the options.php file itself. Then you manually type in the value(blank, file, or post) in the “image_default_link_type” option.
Helpful advises above. I have noticed that many people are using twitter for marketing. I would love to try this too for my business.
This post is very informative and useful.. Thanks for sharing knowledge..
I have the same problem here as some people, there is no option for ‘file’ or anything else shown. I have found this in another file ‘schema.php’
'image_default_link_type' => 'file',but blanking this out had no effect.Any advice for us? Thanks for the post.
Drew
Awesome, been looking for this answer for a while today. Thanks.
Thanks for the help!
helpful advises above…
Pingback: Link Url | AllGraphicsOnline.com
Thanks, this helped a ton!
hehe – it works – thanks – any idea how to revert already added posts ? ( added by attachment unfortunately )
PS. This in the loop of attachment.php isn’t working for me – it just links to a hybrid permalink with the name of the file.
Cheers
Pingback: Better attachment link practices for WordPress | Golden Apples Design
Great article. My mercurial boots gallery is perfect now!
Between me and my husband we’ve owned more MP3 players over the years than I can count, including Sansas, iRivers, iPods (classic & touch), the Ibiza Rhapsody, etc. But, the last few years I’ve settled down to one line of players. Why? Because I was happy to discover how well-designed and fun to use the underappreciated (and widely mocked) Zunes are.
I’m in the same boat. This option does not work for WP 3.xx. I’m surprised the WP documentation isn’t more helpful. I have been looking for a solution for this for days.
In WordPress 3.x the options.php file is very different – I did find image_default_link_type in the includes/schema.php file, but when I change the option from ‘file’ to ‘none’ or ” it seems to have no effect. Any ideas for WordPress 3.x? Thanks in advance.
Pingback: Tweets that mention Changing Default WordPress Media Link URL « Strange Symphonies -- Topsy.com
Pingback: klezmer41 on "Image Uploader: Default to "none" for URL?" | w3 experts
I’ve been looking for this forever, so glad you’ve explained this here. Hooray
I think this doesnt work for wordpress 3.xx
there is no option for “file” or anything
You, sir, have made my night. I’ve been searching for a solution to this for hours. Thank you.
Pingback: Mes favoris du 27-05-10 au 31-05-10 » Gilles Toubiana