Title: please remove empty header image
Last modified: August 19, 2016

---

# please remove empty header image

 *  [Rolf Allard van Hagen](https://wordpress.org/support/users/ravanh/)
 * (@ravanh)
 * [15 years, 11 months ago](https://wordpress.org/support/topic/please-remove-empty-header-image/)
 * First of all, twenty ten is a nice fresh default theme 🙂
 * One request: after hitting “Remove header image” on the back end, so there is
   no header image set, the front still shows a big empty area where the image normally
   would show. This is because even without any header image defined there still
   is an image tag with height and width showing in the header source.
 * This is simply resolved by adding a little if() in header.php like so:
    Replace
   line 64
 *     ```
       else : ?>
       ```
   
 * with
 *     ```
       elseif ( get_header_image() ) : ?>
       ```
   
 * This causes the following line
 *     ```
       <img src="<?php header_image(); ?>" width="<?php echo HEADER_IMAGE_WIDTH; ?>" height="<?php echo HEADER_IMAGE_HEIGHT; ?>" alt="" />
       ```
   
 * to be ignored when there is no header image set ( which would otherwise result
   in that ugly empty src=”” )
 * Thanks! 🙂

The topic ‘please remove empty header image’ is closed to new replies.

## Tags

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

 * 0 replies
 * 1 participant
 * Last reply from: [Rolf Allard van Hagen](https://wordpress.org/support/users/ravanh/)
 * Last activity: [15 years, 11 months ago](https://wordpress.org/support/topic/please-remove-empty-header-image/)
 * Status: not a support question

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
