WordPress: Preselect “Link to Media File” for WordPress Attachments


If you are using a lightbox on your website, like I do on this page, it might be usefull to autoselect the option “Link to Media File” for Attachements.

This can be done without even coding a single line.

First step is to access the advanced options dashboard of wordpress. Just add this at the end of your domain:/wp-admin/options.php

You might have to enter your password again bevore you reach this page:

Use hidden advanced options page of wordpress
Hidden advanced options-page of wordpress.
  1. Search for image_default_link_type.
  2. Add “file” in the textbox next to it.
  3. Scroll all the way down.
  4. Save.

If you are already on it, you might be intressted to also autmatically adding classes to images. Check out the solution here.

Feel free to ask your questions in the comments.


Please enter your comment!
Please enter your name here