Skip to content
Read For Learn
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP

Login Customizer doesn’t change the background of the register form

I gave up on plugins awhile ago to customize the WordPress login. I now create a plugin that links custom CSS into my theme and edit everything myself giving me greater control over the login style. Back in the day most would add to the functions.php file in the current themes directory but now I prefer using a plugin as its just a matter of disabling the plugin if you cause any real damage to your site.

Create a plugin

First create the plugin by heading to wp-content/plugins/ and creating a directory called my-custom-login. Within this folder create a file named my-custom-login.php

Open the file and paste:

<?php
/**
 * Plugin Name: My Custom Login
 * Plugin URI: http://mycustom.login
 * Description: Login page CSS modifications.
 * Version: 1.0.0
 * Author: Joe Bloggs
 * Author URI: http://joe.bloggs
 * License: GPL2
 */

This is a comment section used by WordPress to gather details about the plugin that is shown in the Plugins ==> Installed Plugins section of the WordPress admin area.

Now we will insert our CSS file that we will create in the next section.

Below the plugin information comment add:

function my_custom_login() {
echo '<link rel="stylesheet" type="text/css" href="' . get_bloginfo('stylesheet_directory') . '/custom-login/custom-login.css" />';
}
add_action('login_head', 'my_custom_login');

Create the CSS

Now lets head over to our current themes directory located at wp-content/themes/your-theme-folder replacing your-theme-folder with your current themes name. Within your themes directory we will create a folder called custom-login.

Now within the custom-login folder create a file called custom-login.css

Now lets change everything 🙂

/* This changes the background color */
body.login {
  background-color: #191919;
 }
/* Additionally I added this because on the registration page the color only covers half the page */
body, html {
  background-color: #191919;
}

/* This changes the logo */
.login h1 a {
  background-image: url('login-logo.png');
}

/* This changes the login form box */
.login form {
  background-color: #000000;
}

/* This changes the message box above the login form */
.login .message {
  background-color: #000000;
  border-left: 4px solid #9548e2;
}

/* This changes the paragraph text color */
p {
  color: #FFFFFF;
}

/* This changes the label (i.e Username / Password text */
.login label {
  font-size: 12px;
  color: #FFFFFF;
}

/* This changes the username and password input boxes */
.login input[type="text"]{
  background-color: #ffffff;
  border-color:#dddddd;
  -webkit-border-radius: 4px;
}

.login input[type="password"]{
  background-color: #ffffff;
  border-color:#dddddd;
  -webkit-border-radius: 4px;
}

/* This changes the color of the login button */
.login .button-primary {
  width: 120px;
  float:right;
  background-color:#ad78e2 !important;
  background: -webkit-gradient(linear, left top, left bottom, from(#ad78e2), to(#9548e2));
  background: -webkit-linear-gradient(top, #ad78e2, #9548e2);
  background: -moz-linear-gradient(top, #ad78e2, #9548e2);
  background: -ms-linear-gradient(top, #ad78e2, #9548e2);
  background: -o-linear-gradient(top, #ad78e2, #9548e2);
  background-image: -ms-linear-gradient(top, #9548e2 0%, #ad78e2 100%);
  color: #ffffff;
  -webkit-border-radius: 4px;
  border: 1px solid #bd98e2;
}

.login .button-primary:hover {
  background-color:#ad78e2 !important;
  background: -webkit-gradient(linear, left top, left bottom, from(#ad78e2), to(#9548e2 ));
  background: -webkit-linear-gradient(top, #ad78e2, #9548e2 );
  background: -moz-linear-gradient(top, #ad78e2, #9548e2 );
  background: -ms-linear-gradient(top, #ad78e2, #9548e2 );
  background: -o-linear-gradient(top, #ad78e2, #9548e2 );
  background-image: -ms-linear-gradient(top, #ad78e2 0%, #9548e2 100%);
  color: #fff;
  -webkit-border-radius: 4px;
  border: 1px solid #bd98e2;
}

.login .button-primary:active {
  background-color:#ad78e2 !important;
  background: -webkit-gradient(linear, left top, left bottom, from(#9548e2), to(#ad78e2));
  background: -webkit-linear-gradient(top, #9548e2, #ad78e2);
  background: -moz-linear-gradient(top, #9548e2, #ad78e2);
  background: -ms-linear-gradient(top, #9548e2, #ad78e2);
  background: -o-linear-gradient(top, #9548e2, #ad78e2);
  background-image: -ms-linear-gradient(top, #9548e2 0%, #ad78e2 100%);
  color: #fff;
  -webkit-border-radius: 4px;
  border: 1px solid #bd98e2;
}

/* This changes links hover color */
.login #nav a:hover{
  color: #9548e2 !important;
}

/* This changes the back to blog link color */ 
.login #backtoblog a, .login #nav a, .login h1 a {
  color: #ad78e2 !important;
  text-decoration: none;
}

/* This changes the back to blog hover link color */
.login #backtoblog  a, .login #nav a, .login h1 a:hover {
  color: #9548e2 !important;
}

The /* comments */ will give you an idea of what is exactly changing and you can change the hex colors like for example #ad78e2 to anything you like.

If there is something else you want to change the best way to do it is to install the firebug add-on for Firefox. Once installed you can right-click and select Inspect element with Firebug which will bring up the HTML but if you look to the left side pane you can see the Style tab which shows the CSS. You can change the CSS colors for example in this pane temporarily so you can see what the changes would look like before implementing them.

Now go to Plugins ==> Installed Plugins in your WordPress admin area and activate your plugin.

I know you were asking about a specific WordPress plugin but sometimes learning to dive in to the CSS itself on your own will give you the control you need. And remember if you think you have broken something just simply disable the plugin you created. If you make a major error WordPress should disable the plugin on its own but if you find yourself with a broken site simply ftp or ssh to your wp-content/plugins/ directory and either rename or delete the plugin folder you created.

Related Posts:

  1. How can I replace content on site generated from plugin without changing plugin
  2. Anonymous Postings
  3. Do widget options need to be escaped widget()?
  4. Is there any W3C compatible Share & Follow plugin?
  5. Does any one have Idea to get these functionalities with the plugin wp-multi-network
  6. How to save generated JWT token to cookies on login?
  7. Disable woocommerce cookies and delete cart data automatically
  8. className not populating in custom block
  9. How to fetch products with the price in a page on woocommerce using a form or live search with php
  10. Run plugins only on certain pages
  11. Overide plugin files from child theme (/inc/ ) folder
  12. wp_generate_attachment_metadata is creating an empty array
  13. custom payment gateway in woocommerce failed to connect to remote api server
  14. Display encrypted content on my website
  15. Post category with counts been display like a menu
  16. Post custom Data value in The Events Calendar plugin [closed]
  17. Send reply with pre-prepared answers
  18. Contributive page where people logged in can write
  19. Best way to maintain and update 3rd-party WP plugin when developer is unresponsive?
  20. Save custom attributes of product in woocommerce
  21. Calling an attribute from a plugin shortcode
  22. Best place for short bio,image and button [closed]
  23. Use of Templates in a Plugin
  24. Why can’t I access my Intranet LDAPS with NADI?
  25. External Domain on WordPress Multisite
  26. In the archive widget, how do I sort in between two years?
  27. Customization API for plugin development
  28. Fromcraft Plugin On click submit button [closed]
  29. creating a custom shop page display on archive woocommerce
  30. Setup page on first login on multisite
  31. polylang + category/tag custom language link
  32. Anspress Customization: How to show logged in user votes on a single answer?
  33. Custom wordpress Theme and Plugin repository
  34. Automatic Updates Individual Plugins Not Working
  35. How do I make a child theme I made POST through a 3rd party plugin?
  36. How create Group Blogs based on user created Groups
  37. How to redirect users to their profile after they successfully edit their profile
  38. Custom table naming/access convention for multisite: $table_prefix vs base_prefix or other?
  39. Login cookies set as wrong domain
  40. Add ALT attribute to Pin It Button image to pass HTML5 validation
  41. date/time-picker and file upload (image) fields for custom fields (e.g. with more fields)
  42. Getting Theme element into plugins page editor in wp admin
  43. WordPress as web application base
  44. Customize The Events Calendar to Include an Option to Expand for More Events Listings
  45. URL rewrite of independent plugin?
  46. Plugin for users to create their own ads like Google Adsence
  47. GeoMashup plugin: how to customize cluster markers / icons? [closed]
  48. How do I apply style to each category of a list?
  49. Add category selection to custom post type (plugin)
  50. Redirect to another page using contact form 7? [closed]
  51. changing posts layout in ultimate member profile plugin
  52. “No Add Button” for me to customize my WordPress with themes and pluggins
  53. How to use login_redirect with a user capability
  54. Translation plugin to translate another plugins
  55. Inserting custom PHP script on homepage
  56. Creating Featured Content Boxes
  57. Integrating WP E-commerce plugin into custom theme
  58. easy steps to make front end form without plugin
  59. Best practice for including plugin output in a template without using shortcode?
  60. Custom post types – remove default post supports through empty array?
  61. Basic gallery plugin suggestion [closed]
  62. Change wp-login to custom URL login page
  63. a weird attribute on every html tag
  64. How can I run a custom shortcode function on a live site and only run if the viewer is a specific machine?
  65. Contact Form 7 – Form name blank [closed]
  66. How do i get file_get_contents to work in wordpress
  67. Custom widget doesn’t save values from dropdown box
  68. Plugin Development – Functions or Hooks?
  69. Login problem after installing my written plugin [closed]
  70. Plugin function inside custom plugin
  71. WordPress as template engine
  72. Change the style of h1, h2, only in post entry
  73. Too many login attempts
  74. How to change the wp_upload_dir() path in plugin
  75. Get ‘Headers already sent’ error for the plugin I am creating when I try to login
  76. Add some fileds to the wp_posts table
  77. Custom Login Page — wp_signon Headers Already Sent?
  78. Customizing Titles on the Fly with Code
  79. Disable plugin only for one post
  80. Free paypal cart solution [closed]
  81. Add filter on html tags,attributes on specific function in wordpress
  82. Which plugin can do horizontal scrolling of RSS feeds in WordPress [closed]
  83. When I try to de-activate any plugin it gives error “Warning: call_user_func_array() [function.call-user-func-array]”
  84. Text change in Advanced Customs Fields [closed]
  85. Custom API plugin to execute 3rd party API to retrieve data
  86. Loop in elementor custom widget not working
  87. Theme My Login Shortcode Doesn’t Return Anything
  88. I am trying to make a field show and save from quickedit screen
  89. Overriding an Array in a Plugin’s Class/Function from functions.php
  90. Historical customisations won’t go away [closed]
  91. WordPress – source link plugin – how to modify it?
  92. Moving FB comments at the end of page
  93. Possibility to login without password
  94. Customizing a blog page layout
  95. Minimize and Uglify WordPress Plugin Files
  96. .php file for woocommerce edit category? [closed]
  97. how do i change my website facebook login button to another text immediately user login? [closed]
  98. Advanced WordPress plugin activation detection
  99. Customize Menu | Styling LESS/SCSS code formats
  100. shortcode – multiple instances of same parameter name in one shortcode instance
Categories plugins Tags customization, login, plugins
Load same stylesheet for front end and wp-admin
What’s the proper way to sanitize checkbox value sent to the database

Recommended Hostings

Cloudways: Realize Your Website's Potential With Flexible & Affordable Hosting. 24/7/365 Support, Managed Security, Automated Backups, and 24/7 Real-time Monitoring.

FastComet: Fast SSD Hosting, Free Migration, Hack-Free Security, 24/7 Super Fast Support, 45 Day Money Back Guarantee.

Recent Added Topics

  • Bug in translation system: load_theme_textdomain() returns true, files are available and accessible but the language defaults to english
  • Custom Elementor controls not appearing in the widget Advanced tab using injection hooks
  • Get the name of the template/*html file used
  • Trying to Add Paging to Single Post Page
  • Sharing media files between live and staging servers
  • How to display the description of a custom post type in the dashboard?
  • Critical error on image display
  • Copying WP data and files into new install?
  • How to determine the DirectAdmin WordPress backup date?
  • How to get list of ALL tables in the database?
© 2026 Read For Learn
  • Database
    • Oracle
    • SQL
  • algorithm
  • asp.net
  • assembly
  • binary
  • c#
  • Git
  • hex
  • HTML
  • iOS
  • language angnostic
  • math
  • matlab
  • Tips & Trick
  • Tools
  • windows
  • C
  • C++
  • Java
  • javascript
  • Python
  • R
  • Java Script
  • jQuery
  • PHP
  • WordPress