Title: admin_head
Published: April 25, 2014
Last modified: February 24, 2026

---

# do_action( ‘admin_head’ )

## In this article

 * [More Information](https://developer.wordpress.org/reference/hooks/admin_head/?facet2=pdf&output_format=md#more-information)
 * [Source](https://developer.wordpress.org/reference/hooks/admin_head/?facet2=pdf&output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/hooks/admin_head/?facet2=pdf&output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/hooks/admin_head/?facet2=pdf&output_format=md#changelog)
 * [User Contributed Notes](https://developer.wordpress.org/reference/hooks/admin_head/?facet2=pdf&output_format=md#user-contributed-notes)

[ Back to top](https://developer.wordpress.org/reference/hooks/admin_head/?facet2=pdf&output_format=md#wp--skip-link--target)

Fires in head section for all admin pages.

## 󠀁[More Information](https://developer.wordpress.org/reference/hooks/admin_head/?facet2=pdf&output_format=md#more-information)󠁿

The common usage is to include CSS (external via <link> or inline via <style>) or
JS (external and inline via <script>).

## 󠀁[Source](https://developer.wordpress.org/reference/hooks/admin_head/?facet2=pdf&output_format=md#source)󠁿

    ```php
    do_action( 'admin_head' );
    ```

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

## 󠀁[Related](https://developer.wordpress.org/reference/hooks/admin_head/?facet2=pdf&output_format=md#related)󠁿

| Used by | Description | 
| [iframe_header()](https://developer.wordpress.org/reference/functions/iframe_header/)`wp-admin/includes/template.php` |

Generic Iframe header for use with Thickbox.

  | 
| [wp_iframe()](https://developer.wordpress.org/reference/functions/wp_iframe/)`wp-admin/includes/media.php` |

Outputs the iframe to display the media upload page.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/hooks/admin_head/?facet2=pdf&output_format=md#changelog)󠁿

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

## 󠀁[User Contributed Notes](https://developer.wordpress.org/reference/hooks/admin_head/?facet2=pdf&output_format=md#user-contributed-notes)󠁿

 1.   [Skip to note 4 content](https://developer.wordpress.org/reference/hooks/admin_head/?facet2=pdf&output_format=md#comment-content-2263)
 2.    [lucspe](https://profiles.wordpress.org/lucspe/)  [  9 years ago  ](https://developer.wordpress.org/reference/hooks/admin_head/#comment-2263)
 3.  [You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fadmin_head%2F%23comment-2263)
     Vote results for this note: 0[You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fadmin_head%2F%23comment-2263)
 4.  A basic example (from Hello Dolly plugin code):
 5.      ```php
         function dolly_css() {
         	// This makes sure that the positioning is also good for right-to-left languages
         	$x = is_rtl() ? 'left' : 'right';
     
         	echo "
         	<style type='text/css'>
         	#dolly {
         		float: $x;
         		padding-$x: 15px;
         		padding-top: 5px;
         		margin: 0;
         		font-size: 11px;
         	}
         	</style>
         	";
         }
         add_action( 'admin_head', 'dolly_css' );
         ```
     
 6.   [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fadmin_head%2F%3Freplytocom%3D2263%23feedback-editor-2263)
 7.   [Skip to note 5 content](https://developer.wordpress.org/reference/hooks/admin_head/?facet2=pdf&output_format=md#comment-content-4313)
 8.    [Steven Lin](https://profiles.wordpress.org/stevenlinx/)  [  6 years ago  ](https://developer.wordpress.org/reference/hooks/admin_head/#comment-4313)
 9.  [You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fadmin_head%2F%23comment-4313)
     Vote results for this note: 0[You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fadmin_head%2F%23comment-4313)
 10. Example migrated from Codex:
 11. This example adds an inline CSS style to `admin_head` so the welcome message option
     from dashboard is removed; you can make and customize your own function and add
     it the same way.
 12.     ```php
         <?php 
     
         // Add inline CSS in the admin head with the style tag
         function my_custom_admin_head() {
         	echo '<style>[for="wp_welcome_panel-hide"] {display: none !important;}</style>';
         }
         add_action( 'admin_head', 'my_custom_admin_head' );
         ?>
         ```
     
 13.  [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fadmin_head%2F%3Freplytocom%3D4313%23feedback-editor-4313)
 14.  [Skip to note 6 content](https://developer.wordpress.org/reference/hooks/admin_head/?facet2=pdf&output_format=md#comment-content-4314)
 15.   [Steven Lin](https://profiles.wordpress.org/stevenlinx/)  [  6 years ago  ](https://developer.wordpress.org/reference/hooks/admin_head/#comment-4314)
 16. [You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fadmin_head%2F%23comment-4314)
     Vote results for this note: 0[You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fadmin_head%2F%23comment-4314)
 17. Example migrated from Codex:
 18. In this example, console.log is added, which will only be executed on the admin
     side.
 19.     ```php
         <?php
         // Add inline JS in the admin head with the <script> tag
     
         function my_custom_admin_head() {
         	echo '<script type="text/javascript">console.log(\'admin script\')</script>';
         }
         add_action( 'admin_head', 'my_custom_admin_head' );
         ?>
         ```
     
 20.  [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fadmin_head%2F%3Freplytocom%3D4314%23feedback-editor-4314)

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