Title: Href missing in image links
Last modified: January 16, 2022

---

# Href missing in image links

 *  [Morten Ross](https://wordpress.org/support/users/rosmo01/)
 * (@rosmo01)
 * [4 years, 3 months ago](https://wordpress.org/support/topic/href-missing-in-image-links/)
 * Hi,
 * When inserting images (Add Media) the href tag is no longed part of the link,
   which should look like this:
    `<a href="https://www.ross.no/wp-content/2021/06/
   20210625-DSC_1702-1-4.9-scaled.jpg"><img class="alignnone size-medium wp-image-
   196476" src="https://www.ross.no/wp-content/2021/06/20210625-DSC_1702-1-4.9-700x466.
   jpg" alt="Fiskemåke – Mew gull (Larus canus)" width="700" height="466" /></a>`
 * Instead it’s now just this:
    `src="https://www.ross.no/wp-content/2021/06/20210625-
   DSC_1702-1-4.9-700x466.jpg" alt="Fiskemåke – Mew gull (Larus canus)" width="700"
   height="466" /></a>`
 * This means that images are no longer clickable and zoomable – only the featured
   image – of the post.
 * This post is how it should be working: [https://www.ross.no/2021/06/25/fiskemake-mew-gull-larus-canus-22/](https://www.ross.no/2021/06/25/fiskemake-mew-gull-larus-canus-22/)
 * I have noticed this has happened intermittently in past years after I did an 
   audit on my site’s more than 4k posts and 7k images, but they were just a handful.
 * Last time this worked was in July, and I haven’t created any new posts since 
   then.
 * WP is 5.8.3.
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fhref-missing-in-image-links%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [Sebastien SERRE](https://wordpress.org/support/users/sebastienserre/)
 * (@sebastienserre)
 * [4 years, 3 months ago](https://wordpress.org/support/topic/href-missing-in-image-links/#post-15257540)
 * Hello,
 * IMO, this is not WP related. Front-end is managed by themes.
    Showing a image
   in HTML is : `<img class="alignnone size-medium wp-image-196476" src="https://
   www.ross.no/wp-content/2021/06/20210625-DSC_1702-1-4.9-700x466.jpg" alt="Fiskemåke–
   Mew gull (Larus canus)" width="700" height="466" />`
 * It seems your theme doesn’t chose to add a link around it.
    -  This reply was modified 4 years, 3 months ago by [Sebastien SERRE](https://wordpress.org/support/users/sebastienserre/).
      Reason: correct typo
 *  Thread Starter [Morten Ross](https://wordpress.org/support/users/rosmo01/)
 * (@rosmo01)
 * [4 years, 3 months ago](https://wordpress.org/support/topic/href-missing-in-image-links/#post-15257898)
 * I have a mirror/staging site where this is not present, nor possible to reproduce,
   so there is a condition that occurs which resets this, but I don’t know what 
   that condition is. On live site I’ve had to add
 *     ```
       //The picture is connected to the media file by default (original link) 
       update_option ( 'image_default_link_type' ,  'file' ) ;
       ```
   
 * to the functions.php to force the setting to link image to file. But as I don’t
   have this in functions.php for staging site it points out an inconsistency in
   the enforcement this particular setting.
 * I’ve found several posts regarding this that point to the default behavior of
   linking to image is not static. There are many scenarios with linking to image
   that point to an underlying issue with fully controlling the setting to always
   using link to file.
 * [25578](https://github.com/WordPress/gutenberg/pull/25578), [15865](https://github.com/WordPress/gutenberg/issues/15865)
    -  This reply was modified 4 years, 3 months ago by [Morten Ross](https://wordpress.org/support/users/rosmo01/).

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Href missing in image links’ is closed to new replies.

## Tags

 * [href](https://wordpress.org/support/topic-tag/href/)
 * [image](https://wordpress.org/support/topic-tag/image/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [Morten Ross](https://wordpress.org/support/users/rosmo01/)
 * Last activity: [4 years, 3 months ago](https://wordpress.org/support/topic/href-missing-in-image-links/#post-15257898)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
