LetSOT Tutorials How to Add a Frontend Login Form in WordPress

How to Add a Frontend Login Form in WordPress

When you manage a website that has many users and requires them to log in, adding a login form to the frontend will be very important.

By adding a login form at the front of the site, for example in the sidebar. This will make it easier for users to access their dashboard area.

In this article, we will show you how to add a login form to the sidebar or widget area in WordPress.

Why Adding a Login Form to the Frontend Website is Very Important

By default, the login page will display the WordPress logo which makes the website less professional.

WordPress login page

You can ignore this if the blog you manage has a small scale, such as a personal blog that has a single admin.

However, if you have a site that requires users to login such as an online store or forum. Then adding a login page to the frontend will make the user experience even better.

There are several methods you can use to add a login to the frontend or sidebar in WordPress. That is using code snippets or plugins.

In this guide, we will use the easiest method, which is using a plugin that you can download for free.

How to Add Login Page in WordPress Frontend

To add a login page to the website frontend, you can use the Theme My Login plugin which is available in the official WordPress directory.

Now the first thing you have to do is install and activate the Theme My Login plugin. For more details, you can see our guide on how to install a WordPress plugin.

After activation, in the left panel click Theme My Login > General to open the plugin settings page.

First, you can set the login type. The default settings will allow users to log in using their username or email.

Default Settings Theme My Login

Next, you can move to Registration settings.

In the ‘Password’ section, you can check the box to allow users to create their own password. And ‘Auto-Login’ will automatically bring them to the user’s dashboard page.

Set Registration Page

Next, you can specify the URL in the ‘Slugs’ settings section.

When you change the links in this section. Automatically the default login URL “domain.com/wp-admin” will be redirected to “domain.com/login”.

Change Page Slug

When finished changing links, click the Save Changes button.

The next step is to add a login form to the frontend or sidebar, you have to open the Appearance > Widget menu.

Then find the ‘Theme My Login’ widget, and click widget to add in the sidebar. In the ‘Action’ section, make sure you select Log In.

Add Widget Theme My Login

If using the display ‘Classic Widget’. You can drag the ‘Theme My Login’ widget to the sidebar where you want to place the login form.

Widget Classic Theme My Login

Not only that, you can also use the [theme-my-login] shortcode to create a login form. Make sure you select the ‘Text’ widget, then add a shortcode in the column provided.

Login form with shortcode

Now you can see a preview of the login form in the WordPress sidebar that you have created.

Form Login Frontend

We hope this article helped you learn how to add a frontend login form in WordPress. You may also want to see our guide on how to create a custom login page in WordPress.

22 Likes

Author: Reza Istiawan

Leave a Reply

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

2 Comment