Title: Custom_Image_Header::reset_header_image
Published: April 25, 2014
Last modified: April 28, 2025

---

# Custom_Image_Header::reset_header_image()

## In this article

 * [Description](https://developer.wordpress.org/reference/classes/custom_image_header/reset_header_image/?output_format=md#description)
 * [Source](https://developer.wordpress.org/reference/classes/custom_image_header/reset_header_image/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/classes/custom_image_header/reset_header_image/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/classes/custom_image_header/reset_header_image/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/classes/custom_image_header/reset_header_image/?output_format=md#wp--skip-link--target)

Resets a header image to the default image for the theme.

## 󠀁[Description](https://developer.wordpress.org/reference/classes/custom_image_header/reset_header_image/?output_format=md#description)󠁿

This method does not do anything if the theme does not have a default header image.

## 󠀁[Source](https://developer.wordpress.org/reference/classes/custom_image_header/reset_header_image/?output_format=md#source)󠁿

    ```php
    final public function reset_header_image() {
    	$this->process_default_headers();
    	$default = get_theme_support( 'custom-header', 'default-image' );

    	if ( ! $default ) {
    		$this->remove_header_image();
    		return;
    	}

    	$default = sprintf( $default, get_template_directory_uri(), get_stylesheet_directory_uri() );

    	$default_data = array();
    	foreach ( $this->default_headers as $header => $details ) {
    		if ( $details['url'] === $default ) {
    			$default_data = $details;
    			break;
    		}
    	}

    	set_theme_mod( 'header_image', $default );
    	set_theme_mod( 'header_image_data', (object) $default_data );
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-custom-image-header.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/6.9.4/src/wp-admin/includes/class-custom-image-header.php#L1239)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-admin/includes/class-custom-image-header.php#L1239-L1260)

## 󠀁[Related](https://developer.wordpress.org/reference/classes/custom_image_header/reset_header_image/?output_format=md#related)󠁿

| Uses | Description | 
| [Custom_Image_Header::remove_header_image()](https://developer.wordpress.org/reference/classes/custom_image_header/remove_header_image/)`wp-admin/includes/class-custom-image-header.php` |

Removes a header image.

  | 
| [Custom_Image_Header::process_default_headers()](https://developer.wordpress.org/reference/classes/custom_image_header/process_default_headers/)`wp-admin/includes/class-custom-image-header.php` |

Processes the default headers.

  | 
| [get_theme_support()](https://developer.wordpress.org/reference/functions/get_theme_support/)`wp-includes/theme.php` |

Gets the theme support arguments passed when registering that support.

  | 
| [set_theme_mod()](https://developer.wordpress.org/reference/functions/set_theme_mod/)`wp-includes/theme.php` |

Updates theme modification value for the active theme.

  | 
| [get_template_directory_uri()](https://developer.wordpress.org/reference/functions/get_template_directory_uri/)`wp-includes/theme.php` |

Retrieves template directory URI for the active theme.

  | 
| [get_stylesheet_directory_uri()](https://developer.wordpress.org/reference/functions/get_stylesheet_directory_uri/)`wp-includes/theme.php` |

Retrieves stylesheet directory URI for the active theme.

  |

[Show 1 more](https://developer.wordpress.org/reference/classes/custom_image_header/reset_header_image/?output_format=md#)
[Show less](https://developer.wordpress.org/reference/classes/custom_image_header/reset_header_image/?output_format=md#)

| Used by | Description | 
| [Custom_Image_Header::take_action()](https://developer.wordpress.org/reference/classes/custom_image_header/take_action/)`wp-admin/includes/class-custom-image-header.php` |

Executes custom header modification.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/classes/custom_image_header/reset_header_image/?output_format=md#changelog)󠁿

| Version | Description | 
| [3.4.0](https://developer.wordpress.org/reference/since/3.4.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fclasses%2Fcustom_image_header%2Freset_header_image%2F)
before being able to contribute a note or feedback.