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.
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.
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.
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.
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”.
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.
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.
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.
Now you can see a preview of the login form in the WordPress sidebar that you have created.
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.