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
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.