---
title: Generate SEO and social metadata with Google Gemini AI
url: "https://www.seopress.org/support/guides/generate-seo-and-social-metadata-with-google-gemini-ai/"
lang: en-US
updated: 2026-01-31
---

# Generate SEO and social metadata with Google Gemini AI

[SEOPress PRO](https://www.seopress.org/wordpress-seo-plugins/pro/) 9.5 is required.

## Register to Google Gemini

The first step is to create an account on [Google AI Studio website](https://aistudio.google.com/).

We strongly invite you to register a credit card to avoid any errors from your [Google Cloud Console account](https://console.cloud.google.com/billing).

Go to this [link to check your usage](https://aistudio.google.com/usage?timeRange=last-28-days&tab=billing).

## Create your API key

From Google AI Studio left panel, click on **Dashboard**, **API keys** link.

Click **Create API key** button.

Enter a name for your API key and assigned a project.

[![Modal to create a new Google Gemini API key](https://www.seopress.org/wp-content/uploads/2026/01/google-gemini-ai-seopress-pro-1.png)](https://www.seopress.org/wp-content/uploads/2026/01/google-gemini-ai-seopress-pro-1.png)

*Modal to create a new Google Gemini API key*

Click **Create key** button.

From the **API keys** list, click the **Copy** icon.

## What information is sent to Google Gemini AI?

To get better results and maximize our chance to have a relevant answer from the AI, we send:

- your **post content **(if not possible your post URL),
- your **post language**,
- your **target keywords** (and we ask to put at least one of them in the SEO metadata in return).

Note that we can’t fully control the provided answers by Google Gemini AI.

## Enable Gemini in SEOPress

Go to **SEO**, **PRO**, **AI** tab.

Select **Gemini** from AI provider option.

Paste the key to** Gemini API key** field.

**Save changes**.

[![AI settings - SEOPress PRO](https://www.seopress.org/wp-content/uploads/2026/01/google-gemini-ai-seopress-pro-2.png)](https://www.seopress.org/wp-content/uploads/2026/01/google-gemini-ai-seopress-pro-2.png)

*AI settings – SEOPress PRO*

### Add my Google Gemini AI key to wp-config.php

By adding this code below:

`define( 'SEOPRESS_GEMINI_KEY', 'XXXXXXX' );`

You will store your Gemini API key in your **wp-config.php** file instead of your database. This is more efficient on a multisite network for example but also more secured.

## Generate SEO and social metadata with AI

Now you have linked your Google Gemini AI account with your WordPress site, you can use AI to:

- [generate SEO metadata](https://www.seopress.org/support/guides/generate-your-seo-metadata-with-openai/#generate-your-title-and-meta-description-with-ai)
- [generate alternative texts for your media](https://www.seopress.org/support/guides/generate-alternative-texts-for-your-images-with-openai-and-seopress-pro/)

## Common errors

Quickly test your Gemini API key by going to **SEO**, **PRO**, **AI** tab.

Then from **Gemini** section, click **Test API key** button.

Wait a few seconds to get a positive or negative answer from Google Gemini server.

From the **AI Logs** section (**SEO**, **PRO**, **AI** tab), you will see the messages returned by the AI used.

### 401 – Invalid API Key

- **What it means:** Your Google API key isn’t working
- **How to fix:** Check that you’ve entered the correct API key in SEOPress settings

### 403 – Permission Denied

- **What it means:** Your API key doesn’t have access to this feature
- **How to fix:** Verify your Google Cloud project has Gemini API enabled and your key has the right permissions

### 429 – Too Many Requests

- **What it means:** You’ve made too many requests too quickly
- **How to fix:** Wait a minute and try again. Check your quota limits in Google Cloud Console

### 400 – Bad Request

- **What it means:** There’s something wrong with your request format
- **How to fix:** This is usually a plugin issue. Contact SEOPress support if you see this error

### 500 – Server Error

- **What it means:** Something went wrong on Google’s end
- **How to fix:** Wait a few moments and try again

### 503 – Service Unavailable

- **What it means:** Gemini’s servers are temporarily unavailable
- **How to fix:** Wait 30-60 seconds and retry your request

### 404 – Model Not Found

- **What it means:** The Gemini model you’re trying to use doesn’t exist or isn’t available
- **How to fix:** Check that you’re using a valid model name (like gemini-pro or gemini-pro-vision)
