Generate Google Translate API Key

Setting up API keys for Google Translate

This step-by-step tutorial will guide you through generating a Google Translate API Key.

    1. Create a New Project
    2. Go to API Services and enable Google Cloud Translation API
    3. Create a new API key
    4. Restrict API to particular website
    5. Restrict usage to control costs – Important!
    6. Copy API key
    7. Paste into TranslatePress Settings

Watch this short video for a quick tutorial:

In order to create a Google Translate API Key, you’ll need to sign up for the Google Cloud Console. Keep in mind that while Google does ask for your card information upon sign-up, you can use the translation API for free as long as you stay within the free tier limits (500.000 translated characters/month). This means that your card will not be billed unless you manually upgrade your account to a paid plan.

More information is available at: https://cloud.google.com/translate/.

To create your application’s API key simply follow the steps below:

1. Create a new project in Google Cloud Console

Go to the Cloud Platform Console. From the top bar click the little arrow pointing down, then click the New Project button in the pop-up that opens up.

Google Cloud Platform

Creating a new project in Google Cloud Console

Now, enter your project name and click Create.

Creating a new project in Google Cloud Console

2. Enable Google Cloud Translation API

With the new translation project selected, go to the hamburger menu to the left and visit API & Services.

APIs and services tab in Google Cloud Console

From here you need to enable Google Translate API by clicking the + Enable APIs and Services button in your dashboard.

Enabling APIs and services

This will open the API Library where you will have to search for the Cloud Translation API in the search bar.

Searching for the Cloud Translation API in the Google Cloud Console

Once you’ve identified it, select it and click Enable.

Enabling the Google Cloud Translation API

3. Create a new Google Translate API key

Next, go to the Credentials tab in the sidebar. Click the Create Credentials button at the top of the page and select API Key from the dropdown.

Creating a Google Translate API key

Your API key will now be automatically created.

4. Restrict your API Key to a particular website

Restricting the Google Translate API key to a particular website

Restricting the Google Translate API key to a particular website

In the Google Dashboard, use the HTTP Referrer provided in the description of the Google Translate API Key field in Settings → TranslatePress → Automatic Translation tab, as shown in the following screenshot.

TranslatePress HTTP Referrer for Google Translate API

5. Restrict usage of translation API

In order to have control over the cost of Google Translate API, it is highly recommended to set quotas to limit usage.

From the same APIs and services screen, go to Enabled APIs and services, scroll down on the page, and find the Cloud Translation API.

Enabled APIs and services screen in Google Cloud Console

Click it and then navigate to the Quotas tab.

Quotas tab for Cloud Translation API

From here, you’ll be able to view all your quotas, select the ones you want to modify, and then edit them.

Editing quotas for the Google Translate API

6. Copy your API Key for use in TranslatePress

Go back to the Credentials tab and click the Show key button next to your newly created API key.

Copying the Google Translate API key

A new pop-up will appear to display your API key. Copy it from here.

7. Enable Automatic Translation and add Google Translate API Key in TranslatePress

TranslatePress lets you automatically translate your WordPress site by using Google Translate.

For this, in the WordPress dashboard, navigate to Settings  TranslatePress, and select the Automatic Translation tab. From here make sure to Enable Automatic Translation, by setting it to Yes. Then, under Translation Engine, select Google Translate v2.

This will uncover the Google Translate API key field. Place the API key in this field and Save Changes.

Adding Google API Key in TranslatePress Automatic Translation settings

That’s it! You can now simply navigate to the front-end of your WordPress-powered website and browse it in the language of your choice. You’ll notice the content has been automatically translated.

Looking to go multilingual?

Get full access to TranslatePress and join 200.000+ website owners that grow their multilingual traffic.

Unlock PREMIUM Features

Or download FREE version