This is not able to be changed through a filter. In WordPress 2.9.2 and lower, the setting can be changed in /wp-admin/options.php. The image_default_link_type field is set to “file” by default. If you set it to “none”, then scroll to the bottom and save, it will disable media links.
This option has been removed from options.php in WordPress 3. For versions 3.0 and higher you need to add the following to your theme’s functions.php file or write it into a plugin:
update_option('image_default_link_type','none');
Note: Getting rid of the link affects all media. If you upload .zip, .pdf, music or other types of media that you want people to download from your site you will have to manually add links to these. There is currently an open ticket on the trac for this: http://core.trac.wordpress.org/ticket/15924
Related Posts:
- How to filter the image embed code based on link type
- How might one programmatically set the link for all images in all posts?
- Surround uploaded image link with div
- Filter to remove image dimension attributes?
- Is there a simple way to just insert a link to an image (without inserting an image)?
- Change WordPress image URLs via filter
- Always use for post images
- Change html structure of all img tags in WordPress
- Remove title attribute from images
- hook into completed image upload filter
- Need help building a filter to edit the output of “image_send_to_editor”
- Filter Media Library by author or post_parent
- Preview Image Path in Admin Section
- How to add a link in a image’s caption?
- How to display a shortcode caption somewhere other than the_content
- Alter image output in content
- How can I remove the image attachment ALT field?
- add data-attribute to all images inside the_content()
- Filter to modify post_title after image upload?
- How to remove link from an image in a post?
- Change html structure of all img tags in WordPress
- Disable wordpress image sizes generation
- Remove ‘wp-content/themes/themename/’ from Image path
- Extend core block attributes in post content
- What’s the proper way to use the get_image_tag filter?
- Can I the caption shortcode to set caption to a data attribute, and with the image’s alignment intact?
- How to get image ID to use inside wp_read_image_metadata()?
- All Images on wordpress site broken
- Is there any action/filter hook to use when an image gets edited in the editor?
- How to create ‘Local’ filters for WordPress srcset sizes in template parts?
- Move Image Captions Inside Link ( tag) if Added
- Is it possible to change ‘Link to’ in all images in all articles?
- How to add custom classes to figure element only if image has caption?
- Help With Custom Image and Text Widget
- Change align classes for images
- I am getting useless alphabets in images link
- Add custom text in the media library image meta area
- WP 5.3 Removing Default WordPress Image Sizes
- Filter for post_thumbnail: link to small src and add data-attribute [duplicate]
- Add clickable link on an image
- Remove Image Sizes in Media Settings Page
- How can I use wp_save_image_editor_file filter?
- Clicks registering on Preview DNS site
- How to stop WordPress from completely overriding my tags in my templates?
- How do I link a featured photo to it’s post?
- Is it possible to enable the ‘Link To’ field under ‘Attachment Display Settings’ for a Featured Image?
- Disable Media File Image Link On Mobile Devices
- Prevent WP from wrapping html in caption shortcode after ‘image_send_editor’ filter is applied
- How can I change the to for lazyload wp smilies
- Hiding Media Source Links
- Link to full-size image for subscriber only
- How to display a warning when an uploaded image is too small?
- How to change an image source when rendering on frontend?
- How to change Gallery image url in product page ? In function.php?
- Link to products with the same image title (woocommerce)
- How to get title of images in post content
- How to generate alt attributes with php / filters?
- How to show a full page when someone links directly to an image on my site
- link not working in image section
- How to trigger “wp_handle_upload_prefilter” filter when uploading an image programatically?
- Recovered WordPress installation (on localhost) links broken and images not showing
- js alert in add_filter function for image_send_to_editor
- WordPress 404 Images – Images not found after deleted from media
- Image linking and lightbox
- Server peek by Own-IP-Calls?
- Dinamically modifying attributes of images on posts
- How to attach post ID to image links in WordPress tinymce editor
- image_send_to_editor filter – Unwanted paragraphs and line breaks
- Image filter works on attachement pages but not posts. I can’t get the image ID
- Images not showing after moving site
- Removing image dimensions from `the_content`
- Rename uploads filenames to POST-ID on upload
- Making a thumbnail if there exist a link with. jpg or .png extension in WordPress
- adding images to wordpress pagination?
- Stop underlining image links
- I tried to move the featured image below the paragraphs but now it is displaying twice
- How to add a link to media file for every image inserted in content?
- WordPress update leads to 404 error on admin page and signup. CSS mishap with all plugin related functions
- Replace image with its alt text?
- Get field added via attachment_fields_to_edit filter in Gutenberg
- Neither intermediate_image_sizes_advanced or intermediate_image_sizes filter is firing
- ‘Add Media’ to post – filter images
- How to load only a certain type of image (functions.php)
- Remove tab on product for one category, keep but change image for another
- ‘apply_filters’ is breaking some shortcodes/HTML but not all
- Image sizes reset when changing theme
- How to get featured image of last post in a category?
- How to add element to the list of adjacent images?
- How can I add “alt” tag to element?
- Responsive Images – Defining
- I want to create a hero image with text and a button on my front page. How can I do this?
- How to stop TinyMce from converting image url into ?
- How to automatically load an image inside the post, since it is present in uploads folder
- WordPress and Advanced Custom Fields and Flickity
- How to make image uploads default to full size?
- How to get image ID based on get_theme_mod image URL?
- JPG Image extension not inserting into Custom table of wp
- I cannot upload images to post or the media library in wordpress
- How to attach 1000’s of unattached images
- WordPress images programatically display error