fbpx
How to Add Custom CSS to the WordPress Admin Area

How to Add Custom CSS to the WordPress Admin Area

This snippet will change the default style of WordPress admin area by overriding the old stylesheet (CSS).

Instructions
1) Create a new css file in your theme folder, and then include it in WP-Admin using the admin_head hook.
2) Add this to your functions.php file.

function customAdmin() {
    $url = get_settings('siteurl');
    $url = $url . '/wp-content/themes/my-theme/styles/wp-admin.css';
    echo '<!-- custom admin css -->
          <link rel="stylesheet" type="text/css" href="' . $url . '" />
          <!-- /end custom adming css -->';
}
add_action('admin_head', 'customAdmin');

* Change the paths according to where you put your new/extra wp-admin.css file.
* Add whatever styles you want to override the defaults with, or copy the old stylesheet and use as a template for your new one. Location: /wp-admin/css/colors-fresh.css.

WordPress Snippet Info

Tested with Wordpress v. 4.9.5
Last Modified: 15.05.2018
Last Reviewed: 15.05.2018

How to Add Custom CSS to the WordPress Admin Area
4.7 (93.75%) 16 vote[s]
Please report broken snippets.
Report Broken Snippet
WordPress Hosting - WP Engine