• Hi,

    I just noticed that every image I upload to my posts will now be set to “link to” Media File by default. This wasn’t the case in the past when checking my older posts. It also seems to happen almost randomly now. Checking a few posts, some images are set to link to “none” and others “media file”.

    Is there any way I can set it back to “None” as default?

    Thank you.

    • This topic was modified 4 years, 2 months ago by danniee.
Viewing 3 replies - 1 through 3 (of 3 total)
  • You should be able to remove the links from individual post images using the Block Editor and selecting the “Insert Link” parameter.

    If that option isn’t available to you, your best bet would be to add the following to your functions.php file (if you have access)

    
    add_action( 'after_setup_theme', 'default_attachment_display_settings' );
    function default_attachment_display_settings() {
    	update_option( 'image_default_link_type', 'none' );
    }
    

    This will set the default link type on image media to none. Unfortunately, this will not retroactively change the image link behaviour on already existing media. For that you would need to use a script similar to what is explained here (slightly more complex):

    Remove Existing Self Linking Images in WordPress

    Thread Starter danniee

    (@danniee)

    Amazing. Thank you kind sir ??

    Thread Starter danniee

    (@danniee)

    Hm, seems that code did not work. It also seems lie wordpress saves the last setting that I use when attaching an image. So if I use “link to media file”, next time I upload an image it will use that setting, and vice versa if I choose “none”.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Media display settings now set to “Link to” by default’ is closed to new replies.