Set default WordPress Attachment Display Settings

In WordPress, the attachment display settings (right sidebar when trying to insert media) you can choose to either link to a custom URL, attachment page, media file, or none.

Place the following code in your theme’s functions.php file.

If you want the default link action to be none, then change this line

update_option('image_default_link_type', 'none' );

The options you can change that to are:

  • blank
  • file
  • post

Blank removes the link.
File makes images link directly the image file.
Post links the image to a dedicated URL.

Published by

Chad Ritchie

I'm a freelance web designer, front-end developer. I have taught web design and multi-media courses at the college level and enjoy speaking about user experience, user interface design, social media and the web.