• Skip to primary navigation
  • Skip to main content
  • Skip to footer

Chad Ritchie

Graphic Designer, Front-End Web Developer

  • Blog
    • WordPress
  • Projects
    • Graphic Design
    • Web Projects
  • Photos
  • Services
  • Contact

Set default WordPress Attachment Display Settings

December 12, 2014 By Chad Ritchie

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.

  • Click to share on Facebook (Opens in new window) Facebook
  • Click to share on X (Opens in new window) X

Filed Under: Blog

Footer

Chad Ritchie Web & Graphic Design