Sign inBlogAboutSupportContact
Security

Add Sign in with Google and Continue with Facebook to WordPress without a social-login plugin

Three commands wire up OAuth authorization-code flows for Google and Facebook. Secrets never leave the server. No plugin, no monthly fee, no opaque settings page.

5 min read May 2026 enable google login

Checkout friction is killing your signups right now

Most visitors who hit a registration form and see a password field close the tab. They've done this for every site this week. Your WooCommerce store, your membership site, your course platform: all asking for an email, a password, a confirmation, sometimes a verification link. Each extra step is a visitor you lose.

The problem isn't conversion copy. It's the form itself. Visitors already have Google and Facebook accounts. They are already logged in on this device. You're asking them to create something new when something perfectly good already exists.

What most people do

Install a social-login plugin Most ship their own session handling, their own user table logic, and a settings page that partially overlaps with WooCommerce's own account settings. Updates break things. Abandoned plugins stay installed.
Write it from scratch OAuth authorization-code flow, token exchange, redirect-URI validation, open-redirect guards, user matching, WP session creation: a week of work before you write a single line of your actual product.
Leave the standard form alone Friction compounds. Every extra second on the form is a percentage point off conversion. "We'll add social login later" becomes "nobody gets around to it."

A better way: three commands, two providers

TrueCommander gives you working OAuth flows for Google and Facebook through three commands. Run enable google login to attach a full authorization-code flow to any CSS selector on your site. Run enable google one tap login to show Google's passive One Tap prompt to visitors after a configurable delay. Run enable facebook login to wire up Facebook's OAuth flow to any button you already have. All three exchange tokens server-side, match the returning identity against existing WP users, and create a new account if no match is found.

TrueCommander
Sign in with Google active
OAuth flow attached to .google-btn
Callback URL registeredadd to Google Cloud
client_secret stored server-sidenever sent to browser
New users created at default rolecreate_users=true

Secrets stay on the server. Your client_secret and app_secret are stored in wp_options and used only in server-side token exchanges, the same way SMTP credentials work. They are never serialized into page HTML or sent to the browser. An open-redirect guard on the -redirect parameter also rejects any off-site destination, so a manipulated redirect URL cannot send your visitors anywhere unexpected.

What each command does

Three commands, two providers, one consistent pattern: attach a flow, configure a selector or delay, redirect after success.

CommandWhat it does
enable google loginAttaches a Google OAuth authorization-code flow to a CSS selector. Clicking the element starts a full-page consent screen. Google returns a code; the server exchanges it for tokens and logs the user in.
enable google one tap loginLoads Google's One Tap prompt for non-logged-in visitors after a configurable delay. On success, a Google credential is verified server-side via Google's tokeninfo endpoint and the user is logged in or created.
enable facebook loginAttaches a Facebook OAuth authorization-code flow to a CSS selector. The server exchanges the returned code for an access token, reads the profile from the Graph API, and logs the user in or creates an account.

How it works

1
Run the command with your app credentials and a CSS selector The command stores your credentials in wp_options, registers a callback endpoint, and begins listening for clicks on the selector using event delegation, so late-loaded and SPA-rendered elements work without extra setup.
2
The visitor clicks and the provider handles authentication For Google login and Facebook login, the visitor goes through the provider's full-page consent screen. For Google One Tap, a passive prompt appears on the page. In all cases the provider returns a code or credential to your registered callback URL.
3
The server exchanges the code, matches the user, and redirects All token exchange happens server-side. The visitor's WP session is created, and they land on your -redirect path. If no WP user matches the provider email, a new account is created at the site's default role.
Parameters
DetailValue
Command namesenable google login, enable google one tap login, enable facebook login
Google credentials-client_id (ends in .apps.googleusercontent.com), -client_secret (server-side only)
Facebook credentials-app_id (numeric, 15 to 16 digits), -app_secret (server-side only, also used for appsecret_proof)
Selector supportAny CSS selector (.class, #id, [data-attr]). Event delegation covers late-loaded and SPA elements
One Tap delay-delay: seconds after page load before the prompt appears. Default 3, range 0 to 120
Redirect guard-redirect accepts same-origin URLs and paths only. Off-site destinations are rejected
User creation-create_users default true. Unknown emails get a new WP account at the site's default role
DisablePass -disable=true to any command to turn off the handler while keeping stored credentials
RequirementsHTTPS in production (localhost works for One Tap dev). Register the callback URL shown in command output in your Google Cloud or Facebook app settings
Can be used in

Real example

You run a WooCommerce membership site. Checkout completion is stuck at 54 percent and your analytics show most drop-offs happen on the "Create an account" step. A third of your visitors are on mobile, where typing a password and checking email for a verification link is genuinely painful.

You run tp enable google login -client_id=xxx.apps.googleusercontent.com -client_secret=xxx -selector=.wc-google-btn -redirect=/my-account. The command prints the callback URL you need to add to your Google Cloud OAuth client, which takes about two minutes. You add a button with the class .wc-google-btn to your checkout page template. Done.

You also run tp enable google one tap login -client_id=xxx.apps.googleusercontent.com -delay=5 -redirect=/my-account so returning visitors who aren't logged in see the passive prompt without having to find the button. The next week, checkout completion is at 71 percent. No plugin installed, no subscription started, no settings page touched after the initial run.

Goes further with TrueCommander

Ready?

Cut signup friction with three commands.

One of 91 commands. All included with every license.

Cookies. The short version.

Essential cookies keep the cart and theme working. Analytics only fire if you say yes. Read our policy.