The form for the ‘From Url’ tab seems to be pretty much hard-coded, so I don’t think there is away of removing the ‘Link Image To’ field.
However, for the Media Library tab you can remove the link field, with the following:
add_filter('attachment_fields_to_edit', 'my_attachment_fields_edit', 10, 2);
function my_attachment_fields_edit($form_fields,$post){
//Set attachment link to none and hide it.
$html = "<input type="hidden" name="attachments[".$post->ID."][url]" value=""/>";
$form_fields['url']['html'] = $html; //Replace html
$form_fields['url']['label'] = ''; //Remove label
$form_fields['url']['helps'] ='';//Remove help text
return $form_fields;
}
Related Posts:
- remove links from images using functions.php
- How to add classes to images based on their categories?
- Auto delete WordPress images/thumbnails (all sizes) and featured after X days/hours, or similar?
- How to add a rel attribute to images that contains their categories?
- Best way to programatically add “rel” attributes to page and post images
- What is the “icon” parameter in wp_get_attachment_image_src used for?
- Find first image on paginated post for Pinterest
- Can’t check if a post has thumbnail adding filter to get_post_metadata()
- Image rotation fails to regenerate custom sized thumbnail
- Display images that are not in the content
- Can’t filter wp_get_attachment_link
- Get ID of first image attached to a post
- How to stop wordpress from injecting hard-coded style into image attachments with captions
- How to hide image-url if no attachment?
- attachment page template? only show attachments for current post?
- How to get an attachment id from a filename
- What are the meta fields for an attachment?
- Remove attachment page for audio media type only
- Get Attachment Category Name
- How d0 i get the number of attachments in the post
- Different image using srcset function
- Auto delete content in specific folder inside media library
- WP_Query for Attachments not working as expected
- How to update an image attachment’s alt text from a custom field when saving a post?
- Remove all video attachment, both files and post/postmeta from database?
- Open image size links in a page instead of direct image link
- Set thumbnail from URL, by grabbing image in functions.php
- Disable Attachment Page Except for Category
- How to override parent functions in child themes?
- Define page template in wp_insert_post
- Get a list of all available fields in the User Profile
- How do I use the WP image functions in a page template?
- How to remove Customize from admin menu bar after WP 4.3
- Child theme functions.php do I use php open and close tags?
- Modify Admin Bar Link
- why doesnt is_home() work in functions.php
- Enabling shortcodes for custom fields
- Passing variables to templates (alternatives to globalizing variables)
- Load post with a different template?
- Dynamically Register Sidebars For Each Top Level Page
- Two different menus for two different locations?
- Run Product Filter Javascript On Page Template
- Most efficient way to get custom database records from 20 buttons and 20 tables?
- How to add a column to the Trash page?
- Images uploaded using media uploader are appearing upside down
- Empty Date Returned on my function
- Woocommerce Attributes pulling in wrong data
- How to get the post_name when in preview?
- Display first name of logged in user?
- Identical custom taxonomy slugs for same hierarchical children
- How do I customize my wordpress Admin Area?
- User meta and author meta
- Sorting table function default
- Custom Nav Walker sub-menu
- How do I remove the date and category form my portfolio pages
- Default Custom Field Value Automatically Update
- Get list of all custom tanonomy id
- Add button to kitchen sink toggle
- Get User Login Data (date, time… )
- Modify post filter to set custom number of posts per page and exclude child posts
- Changing parent element’s class or style
- User function to return multiple get_post_meta()
- How can i unload effect.min.js file?
- How can I pass a shortcode value to the head in wordpress functions.php
- Native gallery custom html output
- WordPress wraps span tags into p tags
- Auto scroll to id on page load on all pages except home page. Only do this on mobile
- why is this function firing on all child menu items as well?
- How to add schema markup to WordPress menu function
- Use add_action within template
- Replace admin header logo with an image
- contact form in template with jquery,validate and ajax
- Changing the header image using WPML
- How to require a config file in a template and in function.php?
- Issue passing action class to nested function. Admin Columns
- Populate Product Regular Price with a calculated ACF Field Value
- Header menu aligned right on all pages except for single-post page [closed]
- How Do I Unhook This Parent Theme Function?
- How to create an array if ’empty’?
- Auto remove tags on certain date
- get_field() with ID in one signal filter not working
- i can’t use wordpress functions in ajax loaded php file
- Woocommerce – Switching Price for Category
- Remove External Links from WordPress posts Using add_filter() in Theme functions.php
- How to create a WordPress Customizer Button to Clear a Cache?
- Is there any requirements to do socket programming with WordPress?
- Adding A New Widget to WordPress Disables the Existing Widgets
- Call custom field using php
- Problem in outputting shortcode
- add_theme_support not outputting thumbnails
- How to get tags and categories?
- Archive.php, and post_is_in_descendant_category
- update_user_option not working as expected
- Having problems loading Jquery in functions.php
- How do I access variables outside a function [closed]
- How can I append and prepend something to all post hyperlinks without using ::before or ::after? PHP hook solution?
- Retrieving next_post_link() and previous_post_link() in functions.php
- Working function() doesn’t execute when triggered by WP CRON
- WordPress – Notice: Function wp_enqueue_script was called incorrectly
- post_row_actions filter from parent theme not executing in child theme