# Do Not Link Inserted Images by Default

> Sets the default "Link to" option for images inserted in the classic editor and galleries to None instead of the media file.

- Type: PHP
- Runs: Run everywhere
- Category: [Media](https://wpide.com/library/category/media/)
- Tags: media, images, editor
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/default-image-link-none/

## Code

```php
add_filter( 'pre_option_image_default_link_type', function () {
    return 'none';
} );
```

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Do Not Link Inserted Images by Default" in its snippet library and add it in one click; or create a new PHP snippet in WPIDE (or any code snippets plugin) and paste the code above. More snippets: https://wpide.com/library/
