Affichage des articles dont le libellé est Login. Afficher tous les articles
Affichage des articles dont le libellé est Login. Afficher tous les articles

samedi 12 novembre 2016

How to Create Temporary Login for WordPress (No Passwords)



Have you ever need to create temporary WordPress accounts that automatically expire after a given time? Sometimes you may need to create temporary accounts to give temporary access to the admin area. In this article, we will show you how to create temporary login for WordPress without passwords.


Create temporary login in WordPress without passwords


When You May Need Temporary Login Accounts for WordPress


A lot of our beginners users often hire developers to perform small tweaks on their websites. These developers may need access to the admin area to edit or check something.


If you trust the developer, then you can create an administrator account for them and later delete it when they have done their job.


Similarly, you can add new users and authors in WordPress and later block the user without deleting their account.


However, sometimes you may forget that you added someone with privileges to make changes on your website. This leaves your website open to possible security threats and data safety issues.


Using temporary, logins you can create temporary accounts that require no password to login and are automatically disabled after a given time.


Having said that, let’s see how to easily create temporary login in WordPress that require no passwords.


Video Tutorial



If you don’t like the video or need more instructions, then continue reading.


Adding Temporary Login Accounts in WordPress


First thing you need to do is install and activate the Temporary Login Without Password plugin. For more details, see our step by step guide on how to install a WordPress plugin.


Upon activation, you need to visit Users » Temporary Logins page and click on ‘Create New’ button to add a new temporary login account.


Adding a new temporary login in WordPress


This will show a form where you need to enter information for the temporary login you want to add.


First, you need to provide an email address for the user and then their first and last name.


Adding a new temporary account in WordPress


Next, you need to select a user role for the user. Be careful when selecting a user role. If you are unsure about which user role to assign, then take a look at our beginner’s guide to WordPress user roles and permissions.


Lastly, you need to choose expiry duration for this temporary account. This is the period after which the account will automatically expire.


Don’t forget to click on the submit button to store your changes.


You will now see a success message and URL that anyone can use to login to the temporary account you just added. Click on the ‘Click to Copy’ button to copy the URL and share it with anyone you want to have access.


The temporary account will automatically expire after the time period you selected.


Managing Temporary Logins


The plugin also makes it easier for you to manage temporary logins. Simply visit the Users » Temporary Logins page, and you will see the list of temporary logins you have added to your site.


Manage temporary logins


For each account, you will be able to see the user’s name and email address. You will also be able to see the role assigned to them, last login date, and time remaining till account expires.


Under the actions column, you can expire a login before its expiry, delete an account, or copy the temporary login URL.


Once a temporary account is permanently deleted, all the content created by that user like posts or pages will show the administrator account as the author.


That’s all, we hope this article allowed you to safely create temporary login for WordPress with no passwords. You may also want to see our guide on how to how to monitor user activity in WordPress with Simple History.


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.


The post How to Create Temporary Login for WordPress (No Passwords) appeared first on WPBeginner.







How to Add Security Questions to WordPress Login Screen



Most financial institutions and large companies require you to add security questions on your account for identity verification. Recently one of our readers asked if it was possible to add security questions in WordPress to add an additional security layer. In this article, we will show you how to add security questions to WordPress login, registration, and reset password page.


Adding security questions to WordPress login page


Why Add Security Questions to Login & Registration Forms in WordPress?


There are many ways to protect WordPress admin area from unauthorized access. However, if you run a multi-user or WordPress membership site, then it becomes difficult to choose between security and user experience.


Adding a security question to your WordPress site’s login screen acts like an additional password. Your users can choose a question from a list of random questions and then add an answer to that question.


This makes it difficult for hackers to enter a website using compromised password or email address.


Having said that, let’s see how you can easily add security questions to your WordPress site.


Video Tutorial



If you don’t like the video or need more instructions, then continue reading.


Adding Security Questions to Improve WordPress Login Security


First thing you need to do is install and activate the WP Security Question plugin. For more details, see our step by step guide on how to install a WordPress plugin.


Upon activation, you need to visit Settings » Security Questions page to configure the plugin settings.


Edit, remove, or add security questions


You will see a list of security questions already setup. You can add your own security questions by clicking on the “Add more” button at the bottom. Alternatively you can also edit or remove the existing questions.


At the bottom of the settings pages, you will find the options to enable security questions on login, registration, and lost password pages.


Enable security questions on login, registration, and lost password pages


Don’t forget to click on the save settings button to store your changes.


That’s all. From now on all users on your site will be asked to select and answer their security question on the login page.


Login form with security question


Your WordPress site’s registered users can visit their Profile page to select a security question and add their answer to it.


Users can select a question and add answer on their profile edit page


Users who do not set a security question will still be able to login by just using their username/email and password.


If you enabled security questions on registration page, then new users will be able to select a security question during registration.


WordPress user registration with security question


Enabling security question on forgot password page will ask users to answer their security question to get the password reset email.


If a user’s email address is compromised, then this would stop someone from gaining access by resetting password.


Forgot password


At WPBeginner, we use Sucuri to protect our website from malicious attacks and login attempts. Sucuri is a web security company that offers website monitoring and firewall services.


See how Sucuri helped us block 450,000 WordPress attacks in 3 months.


We hope this article helped you learn how to add security questions to your WordPress login screen. You may also want to see our guide on how and why you should limit login attempts in WordPress.


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.


The post How to Add Security Questions to WordPress Login Screen appeared first on WPBeginner.







How to Create a Custom Login Page for WordPress



Do you want to create a custom login page for your WordPress site? A custom login page allows your users to login from a custom page on your site instead of the default WordPress login page. In this article, we will show you how to create a custom login page for WordPress without writing any code.


Creating a custom login page for WordPress


Why and When You Need a Custom Login Page for WordPress?


If you are running a membership site without using a WordPress membership plugin, then your users will register and login using the default WordPress login screen.


This may work fine for small websites. However, if you are running a business website or a busy online community, then you may want to show your own brand instead of WordPress.


One way to do that is by adding your own logo and white label the WordPress admin dashboard. But if you don’t want users to access the admin area when they login, then you will need to add a custom login page.


A custom login page works like any other page of your WordPress site. It uses the colors and styles of your WordPress theme, and users don’t even get to see the admin area of your WordPress site.


Having said that, let’s see how to easily create a custom login page in WordPress without writing any code.


Video Tutorial



If you don’t like the video or need more instructions, then continue reading.


Method 1: Create Custom Login Page in WordPress with Theme My Login


First thing you need to do is install and activate the Theme My Login plugin. For more details, see our step by step guide on how to install a WordPress plugin.


Upon activation, the plugin will enable custom login page that matches your WordPress theme. You can simply visit the login page, and you will see the custom login page.


Custom login page created with Theme My Login plugin


However, Theme My Login is a powerful plugin. It can also be used to create custom registration and profile pages, custom emails, and setting up custom redirects.


To enable these features you will need to click on the TML menu in the admin bar to configure plugin settings.


Theme My Login settings


Simply check the box next to the module that you want to enable. Enabling each module will also enable the module’s settings tab.


For example, enabling custom emails module will add the Email tab under TML menu item.


Theme My Login custom emails tab


Theme My Login also comes with a custom login widget. Visit Appearance » Widgets page and add Theme My Login widget to a sidebar.


Theme My Login widget


Metod 2: Creating a Custom Login Page for WordPress Using WPForms


WPForms is the most beginner friendly contact form plugin for WordPress. The premium version of WPForms allow you to create custom WordPress login and registration forms.


WPBeginner users can use the WPForms Coupon: WPB10 to get 10% off on their purchase.


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 WPForms » Settings page to enter your license key. You can get this license key from your account on WPForms website.


Adding WPForms license key


After verification, you need to head over to WPForms » Addons page. Scroll down to ‘User Registration Addon’ and click on the Install Addon button next to it.


User registration addon


WPForms will fetch and install the addon. You need to click on the activate button to start using this addon.


Once activated, you are ready to create a custom login form using WPForms. Visit WPForms » Add New page, enter a form name and then select ‘User Login Form’ template.


New login fom


This will launch WPForms’ Form Builder. You will see the login fields pre-loaded in your form. You can click on a field to edit it.


Editing your login form


Next, you need to click on the Settings tab and then select confirmation. This is where you define what to do upon successful login.


Login confirmation


You can show users a message, show them a page, or redirect them to any URL.


Click on the Save button to store your form settings and then click on the close button to exit form builder.


You are now ready to add this custom login form to a page in your WordPress site.


Simply create a new page or edit an existing one that you want to use as your custom login page. Click on the Add Form button above the post editor.


Add form


This will bring up a popup where need to select the custom login form you created earlier and click on the add form button.


The form shortcode will appear in the post editor. You can continue editing the page, or you can save or publish it.


That’s all, you can now visit your website to your custom login page in action.


Login page preview


You can also add the login form as a widget to the sidebar of your WordPress site. Visit Appearance » Widgets page and add WPForms widget to a sidebar.


Select your custom login form in the widget settings and click on the save button to store changes.


Add custom login form to a sidebar widget


WPForms can not only create a custom login page, it can also be used to create a custom user registration page with anti-spam features. See our guide on how to stop spam user registration on your WordPress membership site for detailed instructions.


That’s all, we hope this article helped you create a custom login page for your WordPress site. You may also want to see our list of 10 WordPress plugins that will quickly help you get more traffic.


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.


The post How to Create a Custom Login Page for WordPress appeared first on WPBeginner.







How to Show User’s Last Login Date in WordPress



Recently, one of our readers asked us how to show a user’s last login date in WordPress. You may need this if you wanted to add an author activity box on your WordPress site. In this article, we will show you how to display user’s last login date in WordPress.


Showing a user's last login date in WordPress


Video Tutorial



If you don’t like the video or need more instructions, then continue reading.


Method 1: Showing a User’s Last Login Date in WordPress Admin Area


This method is easier, but it will only show a user’s last login date inside WordPress admin area.


First thing you need to do is install and activate the WP Last Login plugin. For more details, see our step by step guide on how to install a WordPress plugin.


Upon activation, you need to visit ‘Users’ page in the admin area. You will notice a new column showing each user’s last login date.


Last login date column in WordPress admin area


At first it may show ‘never’ for all users. That’s because a user needs to login since the plugin was activated so that it could capture last login date and store it.


Method 2: Manually Show User’s Last Login Date in WordPress


This method allows you to display a user’s last login date anywhere on your WordPress site.


Simply add this code to your theme’s functions.php file or a site-specific plugin.


If you’re new to adding code, then please read this guide on pasting code from the web.



<?php
/**
* Capture user login and add it as timestamp in user meta data
*
*/

function user_last_login( $user_login, $user ) {
update_user_meta( $user->ID, 'last_login', time() );
}
add_action( 'wp_login', 'user_last_login', 10, 2 );

/**
* Display last login time
*
*/

function wpb_lastlogin() {
$last_login = get_the_author_meta('last_login');
$the_login_date = human_time_diff($last_login);
return $the_login_date;
}

/**
* Add Shortcode lastlogin
*
*/

add_shortcode('lastlogin','wpb_lastlogin');
?>

This code adds last login as a meta key. Each time a user logs in, it saves the time as a meta key value. Before you want to test the plugin, you need to logout of WordPress and then login again.


You can then display this meta key value using [lastlogin] shortcode in your WordPress posts and widgets.


If you want to show last login information in your child theme, then you can add this code:



<?php echo 'Last seen: '. do_shortcode('[lastlogin]') .' ago'; ?>

Showing user's last login information in author bio box


As you would notice that this code displays relative date and time, i.e. ‘2 hours ago’ instead of full date and time. If you want to display the full date and time, then locate this line in the code above:


$the_login_date = human_time_diff($last_login);

Now replace it with this line:


$the_login_date = date('M j, Y h:i a', $last_login);

The ‘M j, Y h:i a’ part in this code is called date and time format string. If you want to change how this code displays date and time, then check out our guide on how to change date and time format in WordPress.


We hope this article helped you learn how to show user’s last login date in WordPress. You may also want to see our guide on how to add author info box in WordPress posts.


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.


The post How to Show User’s Last Login Date in WordPress appeared first on WPBeginner.