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
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:
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
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”.)