Email Auto-Login for WooCommerce
WordPress plugin — auto-login users via ?login=email@example.com URL parameter. Ideal for cart recovery emails and personalized campaigns.
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/ank892/email-autologin-woocommerce/archive/refs/heads/main.zipWordPress plugin that auto-logs in users by passing their email address in the URL. Ideal for email marketing campaigns, cart recovery emails, and personalized links sent directly to customers.
How it works
Add ?login=email@example.com to any URL on your site:
https://yourstore.com/cart?set_cart=34557263&login=customer@gmail.com
The plugin will:
- Find the WordPress user with that email
- Log them in automatically
- Remove the
loginparameter from the URL - Load the page normally (preserving all other parameters)
The user lands on:
https://yourstore.com/cart?set_cart=34557263
Installation
From ZIP (recommended)
- Download
email-autologin.zipfrom the Releases page - Go to WordPress Admin → Plugins → Add New → Upload Plugin
- Upload the ZIP and click Install Now
- Click Activate Plugin
Manual
- Copy the
email-autologin/folder towp-content/plugins/ - Activate from WordPress Admin → Plugins
No configuration required — it works out of the box.
Usage examples
# Simple login + go to cart
https://yourstore.com/cart?login=customer@gmail.com
# Login + WooCommerce cart with specific product
https://yourstore.com/cart?set_cart=34557263&login=customer@gmail.com
# Login + go to checkout
https://yourstore.com/checkout?login=customer@gmail.com
# Login + any custom parameter
https://yourstore.com/my-account?login=customer@gmail.com&ref=campaign-spring
Optional configuration
Add to wp-config.php if needed:
// Change the URL parameter name (default: "login")
define('EMAIL_LOGIN_PARAM', 'login');
// Restrict to specific IPs only (empty = all IPs allowed)
define('EMAIL_LOGIN_ALLOWED_IPS', '203.0.113.1, 203.0.113.2');
Behavior reference
| Situation | Result |
|---|---|
| Valid registered email | Auto-login → redirect without login param |
| Email not registered | Does nothing, page loads normally |
| User already logged in | Does nothing |
| Malformed email | Does nothing |
| IP not in allowlist | Does nothing |
Security
This plugin logs users in without a password. The security model relies on the link being sent directly and privately to each recipient (email campaign, WhatsApp message, etc.).
Do not use these links in:
- Public web pages
- Social media posts
- Shared documents
Best practices:
- Always use HTTPS so the email address is not exposed in transit
- Use
EMAIL_LOGIN_ALLOWED_IPSif your email provider has fixed IPs - Combine with short-lived WooCommerce cart sessions
Requirements
- WordPress 5.8+
- PHP 8.0+
- WooCommerce (optional — works with any WordPress site)
License
MIT