Trusted WordPress tutorials, when you need them most.
Beginner’s Guide to WordPress
WPB Cup
25 Million+
Websites using our plugins
16+
Years of WordPress experience
3000+
WordPress tutorials
by experts

How to Add a Login Form in Your WordPress Sidebar

A login form in the WordPress sidebar allows users to quickly sign in from anywhere on your website. Having easy access to a login form can increase sales for ecommerce sites, boost retention for online courses, and more.

At WPBeginner, we’ve helped lots of people design their website and place the login form in the right place. From our experience, we know that there are different themes that show the login option in the sidebar by default. On the other hand, you can use a plugin such as WPForms, like we do, to create different forms and show them anywhere on your website.

In this article, we will show you how to easily add a custom login form to your WordPress sidebar.

How to add a login form in your WordPress

When and Why Do You Need a Custom Login Form in WordPress?

If you run a membership website, online store, or sell online courses, then you likely need your users to log in to perform certain actions.

Since the sidebar appears throughout a website, it makes the login form more noticeable and easily accessible from every page on the site.

Adding a login form to your WordPress sidebar makes it easy for users to sign in to their accounts quickly. This boosts engagement, provides a better user experience, and increases form conversions.

That said, let’s look at how to add a login form to your WordPress sidebar easily. We will show you how to add the default login form in the sidebar and create a custom login form.

You can click the links below to jump ahead to your preferred section:

Method 1: Adding Default WordPress Login Form in Sidebar

You can show the default WordPress login form in the sidebar of your website. This makes it super easy for users to enter their username and password to access the WordPress admin area.

For this tutorial, we will use the Astra theme. Do note that the options may vary depending on the WordPress theme you are using.

To start, you need to go to Appearance » Widgets from your WordPress dashboard.

From here, you can click the ‘+’ button, scroll to the ‘Theme’ heading, and click on the ‘Login/out’ widget block to add it to your sidebar.

Add a login out widget block

Next, you’ll see the ‘Login/out’ block in your widgets area. You can then enable the options to display login as a form.

When you’ve made the changes, click the ‘Update’ button at the top.

See a logout option and update widgets area

After that, you can visit your WordPress website to see the default WordPress login form in action.

Do note that you’ll be logged in if you immediately go check the form. Simply log out of your site to see how the form will appear to your members.

Default login form preview

Method 2: Adding a Custom Login Form Using WPForms Plugin

The default WordPress login form only offers a username and password field. However, you can create a custom user registration form with more fields and customization options.

The best way to do that is by using WPForms. It is the most popular WordPress form plugin, and the premium version of WPForms allows you to easily create WordPress login and registration forms with custom fields.

WPBeginner users can use the WPForms Coupon: SAVE50 to get 50% off on their purchases.

The first thing you need to do is install and activate the WPForms plugin. For more details, see our step-by-step guide on how to install a WordPress plugin.

Upon activation, you need to visit the WPForms » Settings page to enter your license key. You can get your license key from your WPForms account on their website.

Entering the WPForms license key

After verification, you need to go to the WPForms » Addons page.

From here, you need to scroll down to the ‘User Registration Addon’ and click on the ‘Install Addon’ button.

The WPForms user registration addon

The addon will now automatically install and activate on your website.

You are now ready to create a custom WordPress login form. Simply visit the WPForms » Add New page to launch the WPForms builder.

First, you need to enter a form name at the top and then select the built-in ‘User Login Form’ template. Simply hover over it and click the ‘Use Template’ button.

Select the user login form template

It will display the login fields pre-loaded in your form. You can click on a field to edit it or add new fields from the left column.

WPForms offers multiple form fields you can add using the drag-and-drop builder. For example, you can add a name or CAPTCHA form fields to the login form.

Customize your user login form

Afterward, head to the ‘Settings’ tab and click on the Confirmation section.

This is where you need to define what to do once a user successfully logs in to your site.

Go to confirmation settings

The options include a message, a custom page, or a redirect URL to any page on your site.

Ideally, you would want to redirect users to a page once they are logged in. This could be your homepage, WordPress admin panel, or any other page on your website, such as their membership dashboard or client portal.

Next, you can click the ‘Save’ button at the top and exit the form builder.

Your login form is now ready. From here, you can add it to your WordPress sidebar.

Simply visit the Appearance » Widgets page in your WordPress admin area. On this page, add the ‘WPForms’ widget block in the sidebar widget area of your site.

Add WPForms widget block

Next, you can select your user login form from the dropdown menu.

You can view more options in the settings panel on your right. For instance, there are options to show the form title and description.

Edit form settings and update

Don’t forget to click the ‘Update’ button when you are done.

You can now visit your website to see the custom login form WordPress feature.

Custom login form preview

You can also use WPForms to create a custom user registration form with anti-spam features.

We hope this article helped you learn how to add a login form in your WordPress sidebar. You may also want to see our step-by-step guide on how to allow user registration in WordPress and the best WordPress login page plugin.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

Disclosure: Our content is reader-supported. This means if you click on some of our links, then we may earn a commission. See how WPBeginner is funded, why it matters, and how you can support us. Here's our editorial process.

Editorial Staff

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi with over 16 years of experience in WordPress, Web Hosting, eCommerce, SEO, and Marketing. Started in 2009, WPBeginner is now the largest free WordPress resource site in the industry and is often referred to as the Wikipedia for WordPress.

The Ultimate WordPress Toolkit

Get FREE access to our toolkit - a collection of WordPress related products and resources that every professional should have!

Reader Interactions

5 CommentsLeave a Reply

  1. Paul Jurado

    Does the Sidebar Login Plugin still work? The plugin site shows it hasn’t been updated in 3 years and therefore may have some compatibility issues. Please advise.

    • WPBeginner Support

      The plugin appears to be working currently but we will certainly take a look at alternatives.

      Admin

  2. Hafsa

    Hi,
    Could u plz tell me, if i can creat a custome login form for users without the need of registration??

  3. Zion Oyemade

    Just a thought, the WordPress sidebar login has not being updated in two years. I’m wondering if this was an oversight considering that this blog post was recently updated.

Leave A Reply

Thanks for choosing to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and your email address will NOT be published. Please Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.