This has always been a pet peeve of mine. By default, WordPress will set the link to any image that you upload to the file itself. That’s great if you’re using some sort of LightBox setup, but 99% of the time you aren’t. It’s just the image. So if you forget to remove the link…..no dice.
Well, not if you add this handy line to your functions file
Yep, that’s it.
** UPDATE 12/21/2011 **
Thanks to @mitcho for pointing out that we don’t need the option to update every time, only once. So here’s a slightly modified function to check the value first, then update if it isn’t set to ‘none’.
** UPDATE 06/19/2012 **
Seems that the release of WP 3.4 changed how the function operated (slightly). Take a look at the updated function below.