WordPress: Inserting Image with Link Default to None

WordPress: Inserting Image with Link Default to None

Option 1: From WP Admin Options

http://yoursiteurl.com/wp-admin/options.php
Look for image_default_link_type and change its value to ‘none’

Option 2: From Theme’s functions.php

Add this line: update_option('image_default_link_type','none');

13 Comments WordPress: Inserting Image with Link Default to None

  1. Nielz

    In includes/media-template.php there is:

    <select class="link-to"
    data-setting="link"

    data-user-setting=”urlbutton”
    >

    You can set , and the backend shows that, but if you insert the gallery it’s without link=”file”.
    Gnarf.

    THank you for your patience, i’ll look again inside wp, but not today anymore.
    Thanx and best regards!
    Nielz

    Reply
    1. Michael

      Wish I could be more helpful. Taking a rest first might be a good idea. Good luck in solving the issue and feel free to contact if you need my help.

      Cheers.

      Reply
  2. Nielz

    I searched the whole wp-code incl. theme for “link-to” and derivates, but i don’t find anything like that. Maybe it’s time to give up?

    Reply
    1. Michael

      In my opinion, you should try to search for “href=” instead, it may give you lots of matches though. I don’t think you should give up, it should be there somewhere.

      If you are uncomfortable in sharing the link publicly, feel free to send me a private message through the Contact page. Up to you.

      Reply
  3. Nielz

    For single images that’s right, but not for a gallerie. Even for a single image it’s not “none” as i told the options, it’s “file”. And that i want for galleries.

    Sorry, no link, it’s private. *g*

    Reply
    1. Michael

      No worries if you cannot share the link. For gallery, there is also an option to disable the link. However this might depend on the theme you are using.

      Reply
  4. Nielz

    Yes, something else, i am trying to link to the file, as i said. Though: doesn’t work for me.
    I changed it to “none” for a test, and it shows still “attachment”.

    Reply
    1. Michael

      Strange, linking to a (same) file should be the default behaviour. Maybe if you can share a link to your web page, I can understand better. Can you still manually change it to ‘none’ when you are inserting an image?

      Reply
  5. Nielz

    Ah, thanx for the quick reply.
    The option “image_default_link_type” is “file”, what i want. And it’s not an one-click-installation, all manually.

    Reply
    1. Michael

      OK, then you only need to change that value to “none” and you are all set. Unless you are trying to do something else from this.

      Reply
  6. Nielz

    Hi Michael,

    did you test this with WP 3.9? Doesn’t work though, and i tried a lot of other suggestions, nothing works for me, even changing core files didn’t help. It would always link to “attachment”, for galleries especially (i don’t need anything else).

    I am quite desperate about this, do you have any other tips?
    Regards,
    Nielz

    Reply
    1. Michael

      Hi Nielz – I can confirm that this method still works with WP 3.9. What happened when you tried to open http://yoursiteurl.com/wp-admin/options.php? Did you install WP yourself or through a script (one-click app)?

      Reply

Leave a Reply