Auto Registration
Auto Registration automatically creates WordPress/WooCommerce accounts for users who sign in with Google for the first time. This removes friction and enables one-click account creation.
How It Works
When a new user signs in with Google:
User clicks Google Sign-In
↓
Plugin checks if email exists in WordPress
↓
Email NOT found → Create new account
↓
Assign default role
↓
Log user in
↓
User redirected (same page or custom URL)
Configuration
Enable Auto Registration
- Go to Settings > OneTap Login
- Click Users tab
- Check Auto-register users
- Select Default role
- Save Changes

Default Role
| Role | Description | Use Case |
|---|---|---|
| Customer | WooCommerce customer | E-commerce stores |
| Subscriber | Basic WordPress role | Blogs, membership |
| Contributor | Can write posts | Multi-author sites |
| Author | Can publish posts | Content platforms |
If WooCommerce is active, "Customer" is the default. Without WooCommerce, "Subscriber" is used.
User Data Collection
When an account is created, the plugin collects:
| Data | WordPress Field | Source |
|---|---|---|
user_email | Google account | |
| First Name | first_name | Google profile |
| Last Name | last_name | Google profile |
| Display Name | display_name | Combined name |
| Username | user_login | Generated |
| Google ID | _onetap_google_id | Google account |
Username Generation
Since Google doesn't provide usernames, the plugin generates one:
Algorithm:
- Extract email prefix:
john@gmail.com→john - Check if exists in WordPress
- If taken, append number:
john2,john3, etc.
Examples:
john@gmail.com → john
john@company.com → john2 (if john exists)
john.doe@site.com → johndoe
j.smith@corp.com → jsmith
Display Name
Format: {First Name} {Last Name}
Examples:
- "John Smith"
- "María García"
- "田中 太郎"
Account Creation Methods
With WooCommerce
Uses wc_create_new_customer():
$customer_id = wc_create_new_customer(
$email,
$username,
'' // No password
);
Benefits:
- Creates proper WooCommerce customer
- Triggers WooCommerce hooks
- Sets up customer meta
- Compatible with WC extensions
Without WooCommerce
Uses wp_insert_user():
$user_id = wp_insert_user([
'user_login' => $username,
'user_email' => $email,
'first_name' => $first_name,
'last_name' => $last_name,
'role' => $default_role
]);
User Meta Stored
The plugin stores additional meta data:
| Meta Key | Value | Purpose |
|---|---|---|
_onetap_google_id | Google user ID | Link Google to WP account |
_onetap_registered_via | google | Track registration source |
_onetap_first_login | Timestamp | First Google login time |
_onetap_login_count | Number | Total Google logins |
_onetap_avatar_url | URL | Google profile picture |
When Registration Doesn't Happen
Auto registration is skipped when:
1. Email Already Exists
Email found in WordPress
↓
Link Google to existing account
↓
No new user created
2. Auto Registration Disabled
Setting disabled
↓
"Account not found" error shown
↓
User must register manually first
3. Domain Restricted (PRO)
Email domain not in whitelist
↓
"Domain not allowed" error shown
↓
Registration blocked
4. Pending Approval (PRO)
User created with pending status
↓
"Awaiting approval" message shown
↓
Admin must approve
Hooks for Developers
After User Registration
// Fires after a new user is created via Google
do_action('onetap_user_registered', $user_id, $google_data);
Example usage:
add_action('onetap_user_registered', function($user_id, $google_data) {
// Send welcome email
// Add to CRM
// Trigger automation
}, 10, 2);
Before User Registration
// Filter to modify user data before creation
$user_data = apply_filters('onetap_user_data', $user_data, $google_data);
Example usage:
add_filter('onetap_user_data', function($user_data, $google_data) {
// Add custom field
$user_data['nickname'] = $google_data['given_name'];
return $user_data;
}, 10, 2);
Password Handling
No Password Set
Google users don't have a WordPress password by default:
- Authentication happens via Google
- No password email sent
- No password in database
Enabling Password
Users can set a password through:
- Password reset (
/wp-login.php?action=lostpassword) - Profile page (
/wp-admin/profile.php) - WooCommerce My Account
Dual Authentication
After setting password, users can:
- Sign in with Google (One Tap or button)
- Sign in with username/password
- Both methods work
Email Notifications
WordPress Registration Email
By default, WordPress sends a registration email. The plugin:
- Allows the default email to send
- Or replaces with custom welcome email (PRO)
Disabling Default Email
// In your theme's functions.php
add_filter('onetap_send_registration_email', '__return_false');
Custom Welcome Email (PRO)
With PRO, you can:
- Customize the welcome email
- Use merge tags
- Choose templates
See Welcome Email Editor for details.
Role Assignment
Default Behavior
All new Google users get the configured default role.
Role Mapping (PRO)
Assign different roles based on email domain:
| Domain | Role |
|---|---|
company.com | Editor |
partner.org | Contributor |
* (default) | Customer |
See Role Mapping for configuration.
Disabling Auto Registration
When to Disable
- Closed membership sites
- Employee-only portals
- Sites requiring manual approval
- Invitation-only communities
What Happens When Disabled
- User clicks Google Sign-In
- Google authentication completes
- Plugin checks for existing account
- No account found → Error displayed
- User told to register manually
Error Message
Default: "No account found. Please register first."
Customizable in error message settings.
Security Considerations
Email Verification
Google verifies email ownership, so:
- No additional email verification needed
- Email is guaranteed to be valid
- No fake email registrations
Role Restrictions
For security, these roles are never auto-assigned:
- Administrator
- Editor (unless via Role Mapping PRO)
- Shop Manager
Rate Limiting
The plugin includes rate limiting:
- 10 registrations per IP per 5 minutes
- Prevents automated account creation
- Can be adjusted (for developers)
Statistics
Track registrations in the Statistics section:
| Metric | Description |
|---|---|
| Total Registrations | All-time Google registrations |
| Today | Registrations today |
| This Week | Registrations this week |
| This Month | Registrations this month |
See Basic Statistics for details.
Common Use Cases
E-commerce Store
Auto-register: Enabled
Default role: Customer
Result: Frictionless checkout accounts
Membership Site
Auto-register: Enabled
Default role: Subscriber
Result: Easy member signups
B2B Portal
Auto-register: Enabled
Domain restriction: @company.com
Default role: Customer
Result: Only company employees
Closed Community
Auto-register: Disabled
Result: Manual registration required
Troubleshooting
User Not Created
- Check auto-register is enabled
- Verify email doesn't already exist
- Check error messages displayed
- Review debug logs
Wrong Role Assigned
- Check default role setting
- If using Role Mapping (PRO), check domain rules
- Verify user doesn't already exist (keeps existing role)
Missing User Data
- Verify Google OAuth scopes include email and profile
- Check Google Cloud Console configuration
- Test with different Google account
Next Steps
- Account Linking - Existing user handling
- Basic Statistics - Track registrations
- Role Mapping (PRO) - Advanced roles