Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Just wondering if there is a way to remove WordPress's default function of adding a tag around an inserted image. I assume its a "remove_filter" function like you can do for WPAutoP, but all my searches only turned up links for gallery plugins, etc.

Thanks in advance, Pete

share|improve this question
add comment

2 Answers

up vote 5 down vote accepted

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

share|improve this answer
    
awesome thanks! –  pete_schuster Jun 7 '11 at 16:36
    
Not sure if something has changed but it still exist in version 3.5+ under options.php –  jasondavis May 23 '13 at 3:14
add comment

There's an option in the wp_options table called image_default_link_type. Changing that to "none" will prevent the default link wrapped around images.

Visit {yoursite.url}/wp-admin/options.php, find the image_default_link_type field, and change the value to "none". (Other possible values are "file" or "post".)

share|improve this answer
    
Don't ever edit core files. The changes will be lost the minute you update WordPress. –  moraleida Feb 21 '13 at 23:12
    
@moraleida - I agree, but I wasn't suggesting modifying any core files. Options are publicly accessible for just this reason - so users can easily change behavior without modifying any core files... –  goldenapples Feb 22 '13 at 21:25
    
Sorry about that, I completely misread your answer... –  moraleida Feb 25 '13 at 15:49
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.