How to create a really simple custom WordPress login page and sign up page without plugins

There are many different ways of customising the WordPress login page and process. However, many of these methods are over-engineered or are so stylised or complicated that they are difficult to shoehorn into the project that you might be working on.

I’m writing this post in an effort to be super-simple, and provide the most basic of tools needed to create a custom WordPress login page and sign up page.

The key WordPress functions that this tutorial is centred on are:

1. wp_signon – Authenticates a user with option to remember credentials.

2. wp_create_user – This function allows you to insert a new user into the WordPress database.

Note: This tutorial contains no information on styling your login page. I’m presuming you already have a style or design in mind.

Step 1 – Create a new template page called login.php

Very basically, this is what you need to process your form:

And very basically, this is all your login form needs to be:

Once you’ve created the template, create a new page that uses the “Login” template and for the purposes of this tutorial, name it “Login”. You can call it whatever your like, but note that this tutorial has hard-coded references to the page’s URL being:

So you need to make sure that your page’s permalink matches this, or change the URLs in the code to match whatever URL your new “Login” page has.

Step 2 – Done – if you visit your new login page, it should successfully log you in. Now, let’s tidy things up a bit.

So, it’s likely that you’re going to want to redirect anyone trying to use the standard WordPress login pages to your new, custom login page. Easy peasy, shove this in your theme’s functions.php file:

 Step 3 – Now, we do something very similar for the sign up page – create register.php

This code also contains some very basic validation, that creates an array of the errors. You can use these however you like, or just get rid of them for testing purposes.

Further down the register.php template, your sign up form should look something like this:

Then, in WordPress, you create your page called “Register” and you choose this template for it. And once again, we add some redirects to our functions.php file to completely hide the standard WordPress register page:

Again, our register script is assuming that the register page is found at:

You now have login and sign up pages ready to be customised in whichever way you want.

Step 4 – Take a step back, and observe the wonder that you have created

No more bogstandard WordPress login and register pages for your website. This implementation can be further developed with custom logout links and a proper method for dealing with forgotten passwords. I’ll get some guidance on how you do that up on here soon.

4 thoughts on “How to create a really simple custom WordPress login page and sign up page without plugins

  1. This script is little trouble to me.

    below error also affect me worst.

    Warning: Cannot modify header information – headers already sent by (output started at /opt/lampp/htdocs/laxman/beatz/beatz_wordpress/wp-content/themes/mantra/header.php:12) in /opt/lampp/htdocs/laxman/beatz/beatz_wordpress/wp-content/themes/mantra/artistlogin.php on line 22

    please resolve this error.

    thank you.

  2. Hello there,
    I am looking for a long time a way to get the connection and registration on the wp-login.php page, just like the login page of Twitter, Badoo… Have you any idea how to do that? A plugin?
    Thank you.

Leave a Reply

Your email address will not be published. Required fields are marked *