Sending your WordPress website users to the default login page is fine when you’re running a site with just a handful of users. But, in case you’re running a membership site or other sites with large user base, making users access their profile page in the WordPress site’s admin panel via the default login page is something you should avoid.
Wondering why?
It’s a well-known fact that the WordPress login page appears to be bland and boring. No doubt, the login page serves as the central entry point for millions of WordPress sites worldwide. But what if your users don’t really need to access the dashboard?
Well, users belonging to a membership site are not usually interested in accessing the WordPress admin dashboard (except when they need to create a post or perform edit operations). Thus, making those users open up the admin panel through the login page is likely going to prove bad for user experience.
However, you can ensure to deliver an enhanced user experience (UX) by letting users access your WordPress site and its dashboard directly from the front-end. In this post, I’ll let you explore why and when you should provide front-access to your site’s users. Most importantly, I’ll be discussing the plugins that can help add the front-end login feature of your WordPress site.
There are two main reasons as to why you should consider providing your users with front-end access to your dashboard:
1. Optimal User Experience (UX)
Not all the users might like the idea of accessing a WordPress site’s admin dashboard screen using the default login page. Besides, when a user can access the dashboard directly from the front-end why would he/she bother to open up the login page link and enter details to get entry into the admin area. But, forcing users to sign up the login page for opening the dashboard window can result in a bad user experience.
However, by allowing users to access the admin dashboard screen directly from their current front-end page is surely going to help boost UX.
2. Visual Appeal
The new-generation users become readily inclined towards sites that feature a visually alluring design. Of course, you cannot accept users to get accustomed to using the default WordPress login page because of its dull look and feel:
As opposed to the login page in the backend, the front-end likely features a great look and feel. And so, by making your users log in to the dashboard using the front-end access solution such as a login form or a widget could encourage users to remain a loyal member of your site.
Just as we discussed previously, you must take into account having a front-end login page if you run a membership, a multi-author or any other site with lots of users. Doing so, will help avoid any confusion users might have regarding visiting the default login page link and accessing the dashboard.
There are two different ways using which you can add a front-end login page on your site. You can either write custom code to accomplish such an objective or else can use plugins to get the job done.
Method 1: Code to let users redirect to dashboard via front-end login page form
By creating a login form for the front-end is an excellent way to let your users log in to your site and dashboard without leaving the website. Here, I’ll be explaining how you can create a login form on the front-end that redirects users to your site’s admin dashboard. For this, just follow the steps as mentioned below:
newpage-login.php
(or anything else you may like). And then, create a page on your WordPress website backend and set the permalink of that page to login. Doing so, will make your WordPress install recognize the page-login.php
template for the newly created page automatically.wp_login_form
tag within your site’s new page template called newpage-login.php
, as follows:
<?php wp_login_form(); ?>
<?php
$args = array(
'id_username' => 'yourusername',
'id_password' => 'yourpassword',
);
?>
<?php wp_login_form( $args ); ?>
functions.php
of your WP theme:
function redirect_login_page() {
$login_page = frontend_home_url( '/login/' );
$page_viewed = basename($_SERVER['REQUEST_URI']);
if( $page_viewed == "wp-login.php" && $_SERVER['REQUEST_METHOD'] == 'GET') {
wp_redirect($login_page);
exit;
}
}
add_action('init','redirect_login_page');
?>
That’s it! Now whenever the user fills up the form on the front-end, they’ll be redirected to your site’s admin dashboard.
Method 2: Using Plugins to Add Front-End Login Page
Below are three incredibly useful plugins that you can consider for adding front-page login page to your site:
Providing your website users the ability to login to your site or access the dashboard directly from the front-end helps in improving the user experience. When it comes to adding a front-end login page to a WordPress site, you can either use plugins or write code to complete the task. Hope that reading the post will guide you in making the right decision to add front-end feature in your website efficiently.
Do you want to get implementation help, or enhance the functionality of this script? Click here to Submit Service Request
Good write up Sophia. This would definitely help me for upcoming projects.