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
- Disable image attachment links
- How to create thumbnails with a fixed width, so all of them will have the same width?
- Adding custom image size to the media image editor
- How to set the width and height rule for featured image
- Large size image breaks template layout
- Disable all resizing and compression
- wp_get_attachment_image_src() returning incorrect width and height [duplicate]
- Missing background image setting in admin of twenty nineteen
- How to post images on my blog with a pre-defined border
- Images getting smashed
- Unset image sizes before images are uploaded
- Wrap post images with a link, not figure (image_send_to_editor doesn’t work)
- An error has occurred during the upload process in wordpress 5.3.2
- get_the_post_thumbnail() title and alt attributes not displaying
- Load only imagens resized in custom page
- Why does WordPress convert absolute URLs to relative URLs for menu items?
- Getting the Select and Crop Functionality Using Custom Fields
- Need help making my homepage blog image smaller than my post image
- wp_get_attachment_image_src() does not return what I want
- Wrap a post image with a div if it doesn’t have a caption
- How to display image ALT under image?
- Faster image upload on mobile [closed]