Disable image attachment links

Is there a way to disable image attachment links trought a filter in functions.php or something ? I know it’s possible to do it manually when you add an image to a post but I want to disable this functionality by default.

UPDATE

What I want to do is set the “Link URL” option to “none” and remove / hide it from the upload attachement screen.

enter image description here

Is there a solution to hook into the “media-upload” “pop-in” ?

Thanks by advance.

6 s
6

If anybody is interested in do the trick, my solution is this:

function remove_media_link( $form_fields, $post ) {

        unset( $form_fields['url'] );

              return $form_fields;

}

add_filter( 'attachment_fields_to_edit', 'remove_media_link', 10, 2 );

Leave a Comment