How to Use OpenAI with WordPress (Plugin + Setup Example)

There are countless ways to use OpenAI to help manage your WordPress site. And there are also a lot of tools out there to help you do it.
Today, I want to show you a simple plugin that helps you connect WordPress to OpenAI and easily create automatic flows that take hours of work off your back. The WP Webhooks Automator is the glue you’ll need for this, and in the tutorial below, I’ll walk you through a practical setup example that you can easily follow yourself, regardless of what you wish to automate.
In my example, I’m going to show you how to automatically generate a Yoast SEO meta description when a post is updated. We’re using meta descriptions because every website needs them, including yours. They’re important for SEO, but often overlooked, and usually written in a hurry, which makes them a perfect candidate for an AI automation.
However, the real goal here is to show you how WP Webhooks makes OpenAI and WordPress work together. Once you understand the structure behind this automation, from triggering an event to sending data to OpenAI, and writing the response back into WordPress, you can apply the same logic to countless other use cases.
By the end of this tutorial, you’ll have a workflow that not only generates meta descriptions from post titles automatically and only runs when you want it to, leaving existing content untouched, but most importantly, you’ll have a clear understanding of how to build your own working automation.
Who This Workflow is For
This setup is perfect if you:
- Publish content frequently and want consistent meta descriptions;
- Manage multiple authors or multiple sites;
- Use Yoast SEO but struggle with filling in SEO fields;
- Want AI help without giving up control over your content.
What You’ll Need
To make the automation work, here’s what you need:
- OpenAI: https://openai.com/
- Yoast SEO: https://yoast.com/
- WP Webhooks Automator: https://wp-webhooks.com/
Prepare the Setup
Before getting started, please make sure you have the following set up:
- A valid account at openai.com
- Yoast SEO and WP Webhooks installed on your WordPress system
- You must also install the following integrations within WP Webhooks Automator: “Yoast SEO”, “OpenAI”, “WordPress” in the WP Webhooks Pro → Integrations section.
How to Use OpenAI with WordPress (a Yoast Example)
Step 1: Create a New Workflow
- In your WordPress dashboard, go to WP Webhooks Pro → Automations (Flows);
- Give your workflow a clear name, like “Generate Yoast Meta Description via OpenAI”.

Step 2: Set Up the “Post Updated” Trigger
Next, we want this automation to run when a post is updated.
- Add a trigger under WordPress → Post updated;
- Configure it to:
- Trigger only for the post types you want (for example, “Posts”);
- Enable Fire only once per instance to avoid duplicate runs if multiple plugins update the post at the same time.

Once set up, continue to the testing step. There, choose a post based on your liking and update it as you usually update it. Click Finish trigger.

Posts can be updated automatically by other plugins or editors. To make sure your AI-generated meta descriptions only run when you intend, add a conditional check:
- Conditional: 1 > post_meta > _yoast_wpseo_metadesc > 0
- Operator: is
- Value: openai

Make sure to click Set conditionals. We have now created a workflow that automatically fires when a WordPress post has been updated and the Yoast meta description is set to openai. And this way, existing descriptions stay untouched.
Step 3: Add the OpenAI “Create Completion” Action
In the second step, we need to set the OpenAI integration along with the “Create completion” action to automatically generate the meta description based on the post’s title.
Once you’ve added the action, continue to the action settings and save the workflow.

Now head over to the Automations (Flows) → Authentications and create a new authentication template along with the “OpenAPI Credentials” as an authentication type.

Next, you’ll be prompted to enter your OpenAI API key, which you will find within your OpenAI dashboard:

Once you’ve created your API key, head back to the created authentication template and add it in the Key section.

Once added, please head back to your Workflow automation and select the created authentication template within the Action settings of the added OpenAI action.

Now it’s time to set up the required arguments. Here’s what we have used within our example:
Model:
For the model, we have set the latest model “gpt-5.2-pro”.
Prompt:
The prompt contains the instructions for the API to create a response. This is the main ingredient for a successful response of the API. To save you some time, we’ve added the example from the video below:
Write an engaging Open Graph description for Google SEO based on this sentence with a maximum of 140 characters: ADDYOURDYNAMICTITLEHERE Meta description:
Max tokens:
To ensure your meta description gets created accordingly, we set this argument to 500. This means that OpenAI can use up to 500 tokens to create the meta description. To better understand what a token is, check out this manual.
That’s it for the arguments. You can click Continue & save fields.
Next, you can test the action using the “Fire webhook action” dropdown item:

Once tested, it will return to you an example description based on what we set within the “Prompt” argument.
Step 4: Save the Description to Yoast SEO
Lastly, we want to add the generated description within Yoast SEO into the meta description field. To do that, we add the “Yoast SEO” integration and the “Update post SEO data” action. This allows us to customize various values, such as the title, descriptions, keywords, and more advanced settings.
To make sure we update the fields correctly, here are the arguments we added along with the values:
Post:
For the post, we switched the dropdown of static posts to a text field to use the ID of the currently updated post within it.
Title:
Since the title is required for the update, we simply add it as it is from the trigger data via the dynamic dropdown.
Description:
This is the vital part. Here, we will select the description we received from the response of the OpenAI action using the dynamic variables inside the dropdown.

You can update further arguments based on your liking. For example, you can also extract the main keyword from your title using another OpenAI action along with a prompt like “Extract the main keyword from the following sentence: YOURPOSTTITLE”. Then you can fill this keyword into your main keyword of the Yoast action.
Your possibilities are endless.
As the last step, continue the settings and test the action by choosing the “Fire action” item from the dropdown again.
Once done, everything left is to activate the Workflow in the sidebar, and you are ready to go.
Step 5: Test and Activate
Congratulations, you have created a workflow that automatically creates a Yoast SEO meta description based on a given WordPress post title using OpenAI.
To activate everything, make sure to:
- Use Get logs or Fire action in WP Webhooks Automator to test each step;
- Make sure the Yoast meta description field is set to “openai”;
- Activate the workflow.
From now on, any updated post with “openai” in the meta description will automatically receive an AI-generated, SEO-ready description.
This Is Just the Beginning
With this workflow, WordPress isn’t just a CMS anymore; it becomes a smart content assistant. You’re not replacing human editors; you’re removing repetitive tasks and letting AI handle the busywork.
What we built here is a simple but powerful example of what’s possible for your WordPress site when you connect WP Webhooks Automator with OpenAI.
We chose meta descriptions because they’re practical and widely needed. But technically, there’s nothing special about them. The same structure we used here can power many other automations, like generating summaries for blog posts or extracting focus keywords automatically, just to name a few.
WP Webhooks Automator makes it simple to connect WordPress, OpenAI, and Yoast SEO in a professional, scalable way. Start small, automate responsibly, and watch your content workflows transform.
Sign up for WP Webhooks news
Get the latest features, tutorials and promotions directly into your inbox.