Setting the default Wordpress image insert type to 'None'

25 May, 2013 by Tom Elliott

When inserting images into blog posts, I rarely find the need (and I doubt others will too) to link to the full media image. I hate the repetitive task of selecting ‘none’ from the media ‘Link To’ drop down so I finally got round to finding a nice WordPress snippet to get ‘none’ to appear by default in the drop down when inserting a new image from the media gallery.

wordpress image link type dropdown

update_option('image_default_link_type','none');

Simply paste this line at the end of you’re theme’s functions.php file, refresh and job done! Now when selecting the image to insert, the default ‘Link To’ setting under attachment display settings should be ‘None’ rather than the default option for ‘Media File’.

You can of course set the ‘Link To’ drop down to the other available options for ‘Custom URL’, ‘Media File’, ‘Attachment Page’ and ‘None’ by changing the second parameter in the update_option function to ‘custom’, ‘file’, ‘post’ or ‘none’ .



6 Comments

  • didy says:

    thank you very much

  • Bill says:

    Exactly what I am looking for, thank you! Any idea on how to preset the Alt text for the images besides using the plugins.
    Thanks again.

  • Archie says:

    This can be set in wp-admin/options.php

  • Boon says:

    Thank you. It’s very helpful. Save me a lot of time.

  • Jiri says:

    Why would I want it to be ‘none’? Does it affect your SEO when you put your images on None?

    Not sure what the benefit is of changing it to none?

    Thank you for your help!

    Jiri

  • Jack says:

    Thank you. Useful.