WooCommerce URL-Based login: How to let users log into their account by clicking a link
It can be a nightmare to expect your WooCommerce store’s customers to remember their username and password. The ‘Lost Password’ feature in WordPress is all well and good. However, emails can be spammed and it’s plagued with caching problems.
That’s when you need a WooCommerce URL-based login plugin. This type of plugin lets you generate a secret link that users can click on to log into their WordPress or WooCommerce account on your website. They’ll never have to remember a username or password again!
In this article, I’m going to recommend the best automatic login plugin for WordPress and WooCommerce, and tell you how to set it up. I’ll also tell you how to use it with other plugins to allow customers to click on a URL to instantly log into a hidden area of your website that no one else can see. This is perfect for creating a private WooCommerce store, or hidden product categories that only specific users (or user roles) can see. It’s also ideal for creating customer-specific products that are exclusive to each user.
Which is the best WooCommerce URL-based login plugin?
There used to be a free WordPress plugin called – you guessed it – URL-Based Login. This worked on any WordPress site, including WooCommerce online stores. Unfortunately the developer no longer supports this plugin, so you need to find a more modern alternative.
Instead, I recommend the Autologin Links plugin. This is another free WordPress plugin that lets customers log into their WP or WooCommerce account simply by clicking on a link to a secret login URL.
How do the automatic WooCommerce login URL’s work?
The Autologin Links plugin works by letting administrators of your WordPress website create a hidden login URL for each user. They can easily do this on the ‘Edit User’ page under the Users section of the WordPress admin.
You can do this for any WordPress website, including WooCommerce stores. That’s because Woo uses the standard WordPress login facility for its customer accounts.
- First, an administrator logs into the WordPress admin for their WC store, goes to the Users section and clicks on the user who they want to create a URL-based login for.
- Scroll down to the Auto-login section of the page and click the ‘New’ button next to ‘Auto-login link’:
- Copy the URL that appears on the page.
- Give the WooCommerce login link to the customer. Tell them to use it as the instant login link for their account.
- Scroll down to the bottom of the ‘Edit User’ page and click ‘Save’. The URL-based login will only work if you remember to save the page.
- Now send the user a link to their unique login URL for your WooCommerce store (e.g. by email).
- Finally, the user clicks on the link (for example in an email). It automatically takes them to your WordPress website or WooCommerce store and logs them in. They don’t have to enter a username or password. This is because the plugin automatically passes this to WordPress via the auto-login URL.
For example, this sample WooCommerce URL-based login link will take users to the homepage of my website.com and log them into their account.
Each customer will have a unique URL-based login for their account. The random string in my example URL will therefore be different for each person.
Can I use URL’s to log users into a completely hidden WooCommerce store?
Used alone, the Autologin Links plugin lets you provide URL-based login for WooCommerce stores where all the products are public. This means that the products are available for everyone to view, and the user-specific login links simply log customers into their account.
You can extend the Autologin Links plugin to change the actual visibility of products by using it with a WooCommerce protection plugin. Choose one of the following plugins, depending on whether you want to hide some or all of your products.
WooCommerce Private Store
WooCommerce Private Store – as its name suggests – makes your entire WooCommerce store hidden. The rest of your website (e.g. your homepage and blog) remains public, but all the WooCommerce parts (shop page, products, categories, cart, etc.) are hidden from logged out users.
Use WooCommerce Private Store with the Autologin Links plugin to create an auto-login URL that will unlock the hidden store and log them into their account in a single click.
WooCommerce Protected Categories
WooCommerce Protected Categories is similar to WooCommerce Protected Categories, but with more fine-grained control. Instead of making your entire shop private, you can use it to create hidden areas within your store.
- You might have a public shop that anyone can access, and a hidden area that only logged in users with a specific role can see.
- Maybe you need customer-specific products, with a different hidden category for each customer.
Either way, you can use WooCommerce Protected Categories to protect any or all of your categories so that only specific logged in users or user roles can see them. Use it with the Autologin Links plugin to give each customer a unique link, and make their lives easier with WooCommerce URL-based login.
Can I redirect customers to a specific page after they login?
Yes, absolutely. When you create the URL-based login link for each user, simply amend the link to add the URL of the correct page. Just make sure you don’t change the autologin code at the end of the URL.
For example, this login URL will take customers directly to the shop page and log them into their user account:
Alternatively, you can use the free Peter’s Login Redirect plugin to choose where people are taken to after they login. It even has a feature to choose a different login URL redirect for each role or individual user account.
How secure are auto-login URL’s?
Letting your customers login by clicking on a link is – by definition – less secure than requiring a username and password. As a WordPress website manager or WooCommerce store owner, you need to make a balanced decision about usability vs. security.
There are some specific warnings and security tips on the Autologin Links plugin website. I strongly recommend reading these before adding URL-based login to a WordPress or WooCommerce website.
As you can see, allowing users to click a link to automatically login to their account on your WooCommerce website can make your store much more user-friendly. Implement it carefully to maximize security in your store, and relax while your customers log into their accounts with ease.
Can I use URL based login with password protected store and categories?
As well as working with individual user accounts, the WooCommerce Private Store and WooCommerce Protected Categories plugins have password protection options. This means that people can unlock the hidden content by entering a simple password, instead of needing their own unique user account.
Unfortunately this doesn’t work with auto-login URL’s, which only work with actual user logins. To automatically unlock the hidden content by clicking on a URL, you need to use one of the options in these plugins which work with individual user accounts.