Home / Admin / Remove image link from media uploads
Duplicate Snippet

Embed Snippet on Your Site

Remove image link from media uploads

Older versions of WordPress automatically linked the image to the media file.

<10
Code Preview
php
<?php
/* Remove image link from media uploads */
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);

Comments

Add a Comment