Image links in WordPress – custom link not working?


The Image link Issue

When creating a link for an image in one of your posts, upon saving or updating your post,  WordPress defaults the link to the image source.  Annoying? Yes very much.

Apparently the issue has been resolved though has yet to make it into a stable build: Source.

This WordPress thread highlights the issue in greater depth:

Now when you upload an image it puts the url of the image in the link box (to where it is on your own site) and when you attempt to replace that with any other link, say, to the source of the image offsite) it erases it and puts the original.

A temporary solution until wordpress gets updated to version 3 is to link your images as normal in your post, then use the HTML editor to edit the image source and remove the

<a rel="attachment wp-att-3434" href

of the image and replace it with

<a href

Hopefully that tides you over until the bug is finally fixed.

  1. Reply
    Pacca June 27, 2010 at 2:30 am

    Looks like WordPress 3.0 still has this issue 🙁

  2. Reply
    Danny O'Callaghan February 28, 2012 at 9:05 pm

    I had a similair problem to this for my own website
    On my galleries page i wanted the individual images to link to different galleries. However they where linking directly to the image.

    After around 3 hours of looking into this problem, I have found a way to make the images redirect to the correct URL.

    You will firstly need to get the plugin called ‘redirection’ you can find it here:

    Now follow these instructions to make your image link to your required URL
    1. Upload your image as normal
    2. Once uploaded go to the gallery tab in the image upload box.
    3. Now click the ‘attachment link URL tab
    4. Now on the Links to Thumbnails: select Attachment Page
    5. Now save all settings and update your gallery.
    6. Now go to your image and click it – It will go to a post page in your wordpress site.
    7. Next copy that post page link.
    8. Now goto the redirection plugin
    9. Once the plugin is open copy the post page link fromn point 7 to the source URL section of the plugin
    10. now put the URL address in the Target URL where you want the image to point to.
    11. Now goto your website and click the image – It will now be directing.

    This method works 100% of the time and i have wrtitten it down step by step, so if it doesnt work for you, then you are not doing something right.

    This is the page I have used it on

    • Reply
      Nhonpt March 23, 2012 at 7:50 pm

      Thanks Danny! However, it is really inconvenient to edit each image url. Hope that WP can fix this soonest.

    Leave a reply

    Webmix Australia