How to authorize in WordPress via Google Mail

To enable Google Mail login in WordPress, you can use Google OAuth. This allows users to sign in to your website using their Google account. Here’s how to do it:

1. Create a Project in Google Cloud

  1. Go to Google Cloud Console.
  2. Create a new project or select an existing one.
  3. Navigate to API & Services > Credentials.
  4. Click Create Credentials > OAuth Client ID.
  5. Select the application type: Web Application.
  6. Specify the Authorized Redirect URIs:
    • For local development: http://localhost/wp-login.php
    • For production: https://your-domain.com/wp-login.php
  7. Save the Client ID and Client Secret.

2. Install a Plugin for OAuth

The easiest way is to use a ready-made plugin. Here are a couple of popular options:

Plugin: Nextend Social Login

  • Install and activate the plugin from your WordPress admin dashboard.
  • Go to the plugin settings (Nextend Social Login).
  • Enable Google Login.
  • Enter the Client ID and Client Secret obtained from Google Cloud Console.
  • Specify the Redirect URI.

Plugin: Super Socializer

  • Similarly, install and set up Google Login.

3. Configure Access and Validation

  • Ensure your Redirect URIs are correctly configured in Google Cloud.
  • Make sure HTTPS is enabled on the production server (Google requires secure connections).
  • Allow user registration in WordPress if needed (enable it in Settings > General > Allow registration).

4. Test the Functionality

  • Visit the WordPress login page (/wp-login.php).
  • You should see a “Sign in with Google” button.
  • Test the login process to ensure the system correctly creates a WordPress user if they don’t already exist.

5. Customization (Optional)

If you want full customization, you can:

  • Use Custom OAuth Integration with plugins like WP OAuth Server.
  • Write your own plugin or function using the OAuth 2.0 PHP Client.

How useful is the publication?

Click on a star to rate it!

Average score 5 / 5. Number of grades: 1

No ratings yet. Rate it first.

Similar posts

How to transfer a site from dle to WordPress?

Transferring a website from DLE (DataLife Engine) to WordPress can be a complex process, especially if the site has a lot of content. Here’s a step-by-step guide: 1. Preparation 2. Export Data from DLE DLE uses its own database structure, so you’ll need to export data and convert it into a format compatible with WordPress:…
Read more