Ever since I started using WordPress, I have been confused as to why it automatically puts in a link to image files in your post/page. Sure, you can insert the image and then click on the little text tab to take out the link. The only problem is that you have to do this every time and that can take a lot of time. You can even go into your media and select that your image doesn’t link anywhere. That takes too much time too.

So, what is the solution?

A little code for your functions.php file! What does it do? it sets all images added to your media to have the “none” selected for their “Attachment Display Settings” for the “link to” drop down. See the code below and try it out!

function wpb_imagelink_setup() {
$image_set = get_option( ‘image_default_link_type’ );if ($image_set !== ‘none’) {
update_option(‘image_default_link_type’, ‘none’);
}
}
add_action(‘admin_init’, ‘wpb_imagelink_setup’, 10);?>