Back to Community

Fixing the Google OAuth redirect_uri_mismatch Error in WP Mail SMTP

26 threads Sep 9, 2025 PluginWp mail smtp by wpforms

Content

If you're using the WP Mail SMTP plugin to send emails through Gmail, you may have encountered a frustrating error that stops the connection process: Error 400: redirect_uri_mismatch. This is a common issue that stems from Google's security protocols, not from the plugin itself. This guide will explain why it happens and walk you through the most effective solutions.

What Causes the redirect_uri_mismatch Error?

This error is a security restriction from Google. It occurs when the 'Authorized Redirect URI' registered in your Google Cloud Console project does not exactly match the URI that the 'WP Mail SMTP by WPForms' plugin uses during the OAuth authentication process. The required URI is:

https://connect.wpmailsmtp.com/google/

Any discrepancy, such as a missing trailing slash or a typo, will trigger this error. Google's recent interface updates can also sometimes make the correct field difficult to find.

How to Resolve the redirect_uri_mismatch Error

1. Verify the Authorized Redirect URI

The most common fix is to double-check the URI in your Google Cloud Console.

  1. Log into your Google Cloud Console.
  2. Select your project.
  3. Navigate to APIs & Services > Credentials.
  4. Click on the name of your OAuth 2.0 Client ID credentials.
  5. In the Authorized redirect URIs section, ensure the following line is present exactly as shown:
    https://connect.wpmailsmtp.com/google/
  6. Important: The Authorized JavaScript origins section should be left empty. Placing the URI here is a common mistake and will cause the error.
  7. Click Save.

2. Publish Your OAuth Consent Screen

If your app is in "Testing" mode, only specific user accounts can authenticate with it. To make it available, you need to publish it.

  1. In your Google Cloud Console, go to APIs & Services > OAuth consent screen.
  2. If the publishing status is "Testing", click PUBLISH APP.
  3. Confirm the action. This changes the status to "In production".

3. Clear Browser and Google Sessions

Sometimes, a stuck browser session can interfere with the authentication flow.

  1. Completely sign out of all Google accounts in your browser.
  2. Clear your browser cache and cookies.
  3. Sign back in only to the specific Google account that owns the Cloud Console project.
  4. Return to your WordPress site and try the connection again.

4. Follow an Updated Guide

Google's console interface changes over time. If the fields look different than you expect, following a recent, visual guide can be incredibly helpful. The 'WP Mail SMTP by WPForms' team provides a detailed documentation guide with screenshots that reflects the current process.

What If the Error Persists?

If you've checked all the steps above and are still encountering the error, consider these additional troubleshooting steps:

  • Check for Conflicts: Temporarily disable other plugins and switch to a default WordPress theme (like Twenty Twenty-Four) to rule out a conflict.
  • Review Debug Logs: In your WordPress admin, go to WP Mail SMTP > Tools > Debug Events. This may provide a more detailed error message.
  • Ensure Correct Account: When prompted by Google to authenticate, make sure you are logging into the same account that you used to create the Cloud Console project and credentials.

By methodically working through these steps, you can resolve the redirect_uri_mismatch error and re-establish a secure connection between your website and Gmail.

Related Support Threads Support