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