• I’m not sure if this was the way prior to v 2.5 but regardless of whether or not I would like to check if anyone knows if there is a way to disable the “a href” tags inserted into the html every time I insert an image ?

    To put it easier, when I post my image I simply want it displayed there, I do not want it clickable so you can view any direct link to it. I don’t need to disable that or anything similar, the image is there and you can of course still find the direct link using properties for the image, so its more for the look and feel rather than to prevent anything.

    Of course I can easily go into every post and remove the a href tag for every image (and most annoyingly all the duplicates that are generated every time you move the image or do some other change to the post) but I don’t need them from the start t would be easier if they could just be disabled completely ?

Viewing 8 replies - 1 through 8 (of 8 total)
  • Moderator Samuel Wood (Otto)

    (@otto42)

    www.ads-software.com Admin

    On the image insert page, just click the “None” button, instead of Image URL or Page URL. That controls what the image is linked to.

    Thread Starter grimer

    (@grimer)

    Thanks, it seems to work, at least partially, now instead of inserting an a href-link to the image, the addition of an image just adds the tag ‘a href=”Ingen”‘ (Ingen=None in Swedish), this works since there’s no link with that name but wasn’t the purpose rather to not insert the a href at all ? Just curious.

    Thread Starter grimer

    (@grimer)

    Err, bumping this question due to I’ve discovered another small annoying thing in this.
    In the Swedish language, “None” is “Ingen”, and the href tag that gets inserted if you choose to have no link is “a href=Ingen”.

    Well this has another small drawback, I can’t test whether this applies in English too but I would suspect it, someone else can possibly confirm of deny, but when the image has a tag that says a href=Ingen and you click on that (since it’s clickable) you are taken to a bloggentry starting with that word.
    For instance I have a bloggentry with the title “Ingen galleria byggs…” (No mall will be built), and if I click on an image where there’s supposed to be no link I’m taken to that entry.

    Kind of confusing for those who actually follow the links that all images are linked to that one and that it’s completely off topic for all (most) other posts…… ??

    So it’s still back to manually removing the tags from the HTML code.

    I’m new to wordpress, and this is probably *not* the most acceptable way of doing this, but in /wp-admin/includes/media.php (WP version 2.5.1), you can comment out the line $html = "<a href='".attribute_escape($url)."'$rel>$html</a>"; and that’ll prevent all future images from having HREFs added. (It won’t change any existing HREFs, however.) Hope that helps.

    I’m running 2.6

    I would like to disable the “a href” tags from my Media Library.

    Is there a global way to do this?

    Megabulk had good suggestion, however I am using 2.6 and am not sure what to disable exactly.

    Thanks

    I’d like to bump this to see if anyone’s got a suggestion. Is it possible to edit a template to remove the href altogether from images?

    I have a photoblog and the links hit my original source file which are typically several MBs in size. I have about 100 posts at this point and it’s easy enough to go back (though time consuming) and add the photos back in without the link but what’s the point if there’s still an href present?

    Thanks in advance!

    Moderator Samuel Wood (Otto)

    (@otto42)

    www.ads-software.com Admin

    If you hit the “None” button and then add it to the post, then it should not add any a href tags at all. Just the image, not linked.

    Edit: Ah. Okay, this is apparently an IE-specific problem. See here:
    https://trac.www.ads-software.com/ticket/6469

    The latest 2.6 branch has a fix, but that fix has not made it to a release yet. The change to make is given here:
    https://trac.www.ads-software.com/changeset/8915

    Thanks for the update – fingers crossed the fix gets here soon. ??

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Can I disable a href in image tags ?’ is closed to new replies.