Tired of changing image or media attachment setting at every upload? By default, there is no settings feature in WordPress Dashboard to modify default “attachment display settings”. For example: if image aligment is set to “left” and image hotlinks to “post” – you need to manually change this at every image upload routine.

Modify default attachment display options in WordPress

modify default attachment media display settings wordpress

1. You can easily change default settings for image or media attachments in WordPress. Just add the following code to functions.php file of your WordPress theme for this change.


2. In above code: For image alignment (image_default_align), you can use left, right, center options. For image linking (image_default_link_type), you can use custom (for linking to custom url), post (links to dedicated url), file (links to direct image url), blank (no link). You can also change options for image size (image_default_size).

Another way of editing Options.php file

You can also make above change by editing options.php file of your WordPress website. Instead of above code, open options.php file and look for (image_default_link_type) in it. Modify setting for the same in options.php. But this method is not recommended, as you will lose this customization during WordPress upgrade to new version. Using above method of adding code to functions.php file is recommended.

Davinder Singh Kainth

A digital creator with 15+ years of experience in Website Design, Development, SEO, and Content Creation to Podcasting at SmartWebCreators.com with the motto of "Be Smart, Keep Creating". A coach, consultant, and your dear geek friend ❖

1 Comment

  1. Muhammad Amin on February 20, 2014 at 10:31 am

    Hi there,

    Very nice article. I need to modify the attachment display settings for audio files. In the current version of wordpress whenever i add a mp3 file to my post, the default option is ‘Embed Media Player’, rather i want it to be changed the second option in the list that is ‘Link to Media File’. Please help i need this.
    Thank you in advance

Leave a Comment