How to customize the WordPress Admin Login Page

How to customize the WordPress Admin Login Page

WordPress is an open source content management tool. It is written in PHP and MySQL. It is used to make beautiful full-fledged websites easily. WordPress can be customized easily by making changes to simple PHP functions. In this tutorials, you will learn simple ways to customize the WordPress admin page by adding a new background, changing the default logo,

Prerequisites

  • Domain name (e.g., example.com)
  • Text Editor
  • WordPress admin credentials

Step 1:

Go to your current theme folder and create a folder and name it admin-login. Inside the folder create a text file and save it as my-custom-css.css

To make sure WordPress access this .css file you need to make some changes to WordPress theme’s function.php file. The function.php can be accessed through the WordPress dashboard inside the Appearance menu

Open the functions.php file and add the following line of code and update the file

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

This will tell WordPress to look at our custom css when loading the admin login page.

Step 2:

You can replace the default WordPress logo and add your own custom logo by adding some lines of code to our newly created css file.

.login h1 a {
  background-image: url('my-login-logo.png');
}

You need to make sure your logo file my-logo.png is present in the admin-login folder.

Step 3:

You can also replace the plain background image with your own custom background image. To do so, add another set of codes to your CSS file and save the file.

body.login {
  background-image: url('admin-bg.jpg');
  background-repeat: no-repeat;
  background-attachment: fixed;
  background-position: center;
}

Again, you need to make sure the file admin-bg.jpg is inside the admin-login folder.

Step 4:

You can also change the logo link to wordpress.org to your own link. To do that add the following line of codes to your theme’s function.php file.

// Use your own logo link
function wpc_url_login(){
  return "http://www.example.com/"; // }
add_filter('login_headerurl', 'wpc_url_login');

Conclusion:

By making some changes in the theme’s function.php file and adding your own .css file you can customize the admin login page to your liking.

 

Check out these top 3 WordPress hosting services:

A2 Hosting
$2.99 /mo
Starting price
Visit A2 Hosting
Rating based on expert review
  • User Friendly
    4.5
  • Support
    4.0
  • Features
    4.5
  • Reliability
    4.8
  • Pricing
    4.0
IONOS
$1.00 /mo
Starting price
Visit IONOS
Rating based on expert review
  • User Friendly
    4.5
  • Support
    4.0
  • Features
    4.5
  • Reliability
    4.5
  • Pricing
    4.3
HostArmada
$2.49 /mo
Starting price
Visit HostArmada
Rating based on expert review
  • User Friendly
    4.5
  • Support
    4.5
  • Features
    4.5
  • Reliability
    4.5
  • Pricing
    4.0

How To Increase Maximum File Size Upload In WordPress

Low file size limit in wordpress can stop you from uploading some plugins, theme
1 min read
Avi Ilinsky
Avi Ilinsky
Hosting Expert

How To Debug And Log Errors In WordPress Site

In this guide, we will learn how to debug and log errors that starts appearing o
2 min read
Max Ostryzhko
Max Ostryzhko
Senior Web Developer, HostAdvice CTO

How to Fix “Error Establishing Database Connection.” in WordPress

Error Establishing a Database Connection is one of those curses that could be ca
4 min read
Eliran Ouzan
Eliran Ouzan
Web Designer & Hosting Expert

How To Logout All Users In WordPress At Once

What will you do if your WordPress site has been hacked or want all the users to
2 min read
Eliran Ouzan
Eliran Ouzan
Web Designer & Hosting Expert
HostAdvice.com provides professional web hosting reviews fully independent of any other entity. Our reviews are unbiased, honest, and apply the same evaluation standards to all those reviewed. While monetary compensation is received from a few of the companies listed on this site, compensation of services and products have no influence on the direction or conclusions of our reviews. Nor does the compensation influence our rankings for certain host companies. This compensation covers account purchasing costs, testing costs and royalties paid to reviewers.
Click to go to the top of the page
Go To Top