Skip to content Skip to navigation

Generate your SEO metadata with OpenAI and SEOPress PRO

Since SEOPress PRO 6.3, you can automagically generate your SEO title and meta description based on your post content.

To do this, an OpenAI account is required.

Register to OpenAI

The first step is to sign in for free at OpenAI.com website.

Once done, go to your Account > API Keys page to generate your first OpenAI API key by clicking Create new secret key button.

Copy the key.

Create your secret API key in OpenAI
Create your secret API key in OpenAI

What information is sent to OpenAI?

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).

For alt text, we send the image file URL only.

Note that we can’t fully control the provided answers by OpenAI.

Enable AI in SEOPress

Login to your WordPress admin.

Go to SEO, PRO, AI tab.

If it’s not the case, activate the AI feature by clicking the blue iOS toggle.

Then paste the OpenAI key in the dedicated field.

Save changes.

Add my OpenAI key to wp-config.php

SEOPress PRO 6.9 is required for this.

By adding this code below:

define( 'SEOPRESS_OPENAI_KEY', 'XXXXXXX' );

You will store your OpenAI 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.

SEOPress OpenAI settings
SEOPress OpenAI settings

Generate your title and meta description with AI

Now let’s try to make our first call to the AI. Edit the post, page or post type of your choice with Classic Editor or the Block Editor (Gutenberg).

Scroll down to the SEO metabox.

You will see two new buttons from the Titles settings tab called “Generate meta title with AI” and “Generate meta description with AI“.

Click on it.

Wait a few seconds and boom your title and meta description are automatically generated based on your post content.

Adjust the values if necessary, and that’s it!

Generate SEO metadata with AI and SEOPress
Generate SEO metadata with AI and SEOPress

Generate SEO metadata in bulk

Go to your post types list, select a few posts, then from the bulk actions select, choose Generate meta title with AI and click Apply.

Wait some seconds, the page refresh and voilà!

Do the same for meta description.

Note that depending on the amount of posts selected it can take a certain amount of time to get your metadata generated. Be patient!
SEOPress AI bulk actions
SEOPress AI bulk actions

Use WP CLI & AI to generate SEO metadata

If you’re a developer, you will love this feature! Learn more about this in our dedicated guide to CLI & AI.

Generate alternative texts for your images files

Follow this guide to automatically create alt texts when you upload images to the WordPress library.

Common errors

With SEOPress PRO 6.9, go to SEO, PRO, AI tab, and click Check OpenAI key button to check the status of your key. It will help you understand any issue.

401 error

  • Make sure you have entered an OpenAI API key (NOT a Chat-GPT key)  to SEO, PRO, AI tab, OpenAI API key field.
  • Make sure your key is correctly entered.

429 error

  • Make sure your OpenAI API key has not expired from your OpenAI account.
  • You’re using a ChatGPT subscription instead of an OpenAI key.
  • OpenAI is temporary down.
  • You’re sending too much requests, just slow down.
  • Your key has not been replaced by your web-browser with autocompletion feature when saving other options from SEO, PRO.
  • Your free trial has expired, check the Usage page to see if it’s the case.
Using the OpenAI key requires that you have a credit balance in your account. This might come from a free trial, or you may have to purchase credit to add to your account. If you do not have a balance, the API will generate an error when trying to verify the key or use the key to generate metadata.

Learn more from the official website.

Firewall?

If you use a firewall, make sure to whitelist openai.com domain name from your settings.

Requirements for GPT-4 Vision

If you have selected this model, make sure to have at least made a $5 payment to OpenAI platform before using it.