Skip to content

Instantly share code, notes, and snippets.

@jesgs
Last active August 29, 2015 14:23
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jesgs/33c6ba07fe9fbb3d4322 to your computer and use it in GitHub Desktop.
Save jesgs/33c6ba07fe9fbb3d4322 to your computer and use it in GitHub Desktop.
A method for removing all default styles from WordPress login screen.
<?php
/**
* Remove all WordPress-specific stylesheets from WordPress login screen
*/
/**
* Force-remove login-related styles. Can't use the regular method of login_enqueue_scripts
* due to wp_admin_css running before login_enqueue_scripts
*
* @param WP_Styles $styles Current WP_Styles object containing dependencies
* @return WP_Styles
*/
function ex_remove_login_styles(WP_Styles $styles)
{
$styles->registered['login'] = array();
return $styles;
}
add_action('wp_default_styles', 'ex_remove_login_styles');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment