How to Generate WordPress Posts with Gemini AI

In this tutorial, we will show you the best way to generate WordPress posts with Gemini AI. You’ll be able to write blog posts using Google Gemini, both for creating posts from scratch or writing post content based on the post title.

And everything will be done directly on your WordPress dashboard. You can use any AI provider and LLM, but in this tutorial we will use Gemini through the OpenRouter API.

Tools to generate WordPress posts with Google Gemini

To generate WordPress posts using Google Gemini AI, you need these tools:

1- WP Sheet Editor – Post Types

This plugin allows you to view and manage WordPress posts, pages, and custom post types in a spreadsheet interface on the WordPress dashboard.

You can skip this step if you already have the plugin.

2- WP Sheet Editor – AI

It’s an AI assistant service that allows you to connect with different AI providers and LLMs. You can integrate the use of artificial intelligence in all spreadsheets of the WP Sheet Editor suite.

3- OpenRouter API

The AI functionality in WP Sheet Editor relies on an external API like OpenAI, OpenRouter, etc.

WP Sheet Editor – AI works perfectly with OpenAI and other providers that use the same format as OpenAI.

But in this tutorial, we will use the OpenRouter API to run Gemini and generate WordPress posts (more info here).

Let’s set up Google Gemini for generating WordPress posts:

  1. On your WordPress dashboard, go to WP Sheet Editor > AI > Settings > Settings.
  2. Provider: OpenRouter
  3. Model Key: In this example, we will use Google: Gemini Flash 2.0, so we need to add this: google/gemini-2.0-flash-001
  4. API Name: openrouter – google/gemini-2.0-flash-001
  5. API Key: Add your OpenRouter API key here.
  6. Model Context Lenght: Context length is the maximum amount of tokens that you want to send to the model in a request, this includes the past messages in a chat or the row context when you edit in the sheet. The higher context length, the more expensive your API usage will be.
  7. What is the purpose of this model: You can select any of these options:
    • Chat
    • Add new rows with AI
    • Cell editions
    • Bulk Edit
  8. Save the changes.

generate-wordpress-posts-gemini

Prompt for generating WordPress posts with Gemini

Here we share with you a prompt that you can use to generate post content based on the post title. Please make sure you test and customize the prompt to ensure it gives you the best results and fits your needs.

We have created two versions in case you’re using Gutenberg or the classic editor of WordPress:

If you’re using Gutenberg editor, use this prompt:

Write a blog post based on the title $Title$, starting with an engaging introductory paragraph without using a heading tag. Ensure the content is SEO-optimized, engaging, and properly formatted using valid Gutenberg block syntax for WordPress. Structure the content with <p> tags inside <!-- wp:paragraph --> blocks for paragraphs, use <!-- wp:heading {"level":2} --> for <h2> headings (adjusting levels as needed), and format lists with <!-- wp:list --> blocks containing <ul> or <ol>. Avoid using overarching tags like <html> or <body>, as they are unnecessary. The content should be ready for direct insertion into WordPress and fully compatible with the Gutenberg editor.

If you’re using classic editor, use this prompt:

Write a blog post based on the title {Title}, starting with an engaging introductory paragraph without using a heading tag. Ensure the content is SEO-optimized, engaging, and formatted with clean HTML for direct insertion into the WordPress Classic Editor. Structure the content using the following HTML elements: wrap paragraphs in <p> tags, use <h2> for main headings and <h3> (or other levels) for subheadings, and format lists with <ul> and <ol> for unordered and ordered lists, respectively. Avoid using <html>, <body>, <header>, or <footer> tags, as WordPress handles these automatically.

Optional: Use save it as global prompt

With WP Sheet Editor – AI, you can create a bank of global prompts that you can use in WP Sheet Editor spreadsheets. This is great because when you want to use a specific prompt, you won’t have to type it in full, but you could use a simple shortcut like ai:write-post, ai:summarize-post, etc.

You can learn more about global prompts here.

If you want to save this as a global prompt, you need to follow these steps:

Go to WP Sheet Editor > AI > Settings > Prompts.

Once there, click on Add new to create a new prompt.

Add the prompt Name and Prompt text, and click on Save.

generate-wordpress-posts-gemini

After saving the changes, you’ll see the newly generated slug, which you can now use to run this prompt in WP Sheet Editor.

If you’ll use this prompt in spreadsheet cells, you can type ai:write-post, for example, in order to use the prompt you’ve just created. Just make sure what you add after ai: is the actual slug of your global prompt.

generate-wordpress-posts-gemini

Open the WordPress posts spreadsheet

Go to WP Sheet Editor > Edit posts to open the WordPress posts spreadsheet.

Method 1: Generate complete posts from scratch using Google Gemini

This is great if you want to write blog posts about a specific topic but don’t have neither titles, nor outlines, and not even ideas. Basically, you can ask Gemini to create a specific number of blog posts about a certain topic like “productivity”. And the best part is that you can generate AI content for every field (title, content, excerpt, SEO title, SEO description, etc.)

To write posts from scratch with Gemini, start by hovering the mouse over Add new and select Add rows with AI.

generate-wordpress-posts-gemini

Now you need to set up the post generation details. Here’s how you can do it:

  • How many rows do you want to add: Enter the number of posts you want Gemini to create.
  • What columns do you want to auto fill with the AI: You can select all the fields for which you want to generate AI content. In this example, we will generate content on these three fields:
    • Title
    • Content
    • Excerpt
  • Prompt: Enter the prompt you will use to generate WordPress posts. Here’s an example:
Write blog posts on productivity, each starting with an engaging introduction that explains the importance of the topic. Cover practical strategies, scientific insights, and real-life examples to help readers improve their productivity. Structure the content using valid Gutenberg block syntax for WordPress, with <!-- wp:paragraph --> for paragraphs, <!-- wp:heading {"level":2} --> for <h2> headings (adjusting levels as needed), and <!-- wp:list --> blocks for unordered and ordered lists. Ensure each post is clear, actionable, and engaging, providing real value without unnecessary filler.
  • Do you want to set default values for the other columns: You can set default categories, default status, etc., for all the posts you will generate.
  • Click on Create the rows.

generate-wordpress-posts-gemini

Once your posts have been generated, you’ll see them displayed in the spreadsheet. You can now use the spreadsheet to modify the posts to your liking before publishing them to your blog.

generate-wordpress-posts-gemini

Method 2: Generate post content based on post title

If you don’t want to generate the posts from scratch, and instead have the post titles, you can use Gemini to generate post content and other fields based on the post title.

For example, let’s imagine you have a list of posts you would like to write and publish on your blog. However, you don’t have the time to get down to writing, nor do you want to hire someone to write the posts for you. Nor is your creativity at its best. In this case, having the post titles is a great start because you can then start generating the missing data for your posts using Gemini (Content, Excerpt, etc.).

As you can see in the screenshot below, we have the list of post titles, so we have already created the entries, but only with titles.

generate-wordpress-posts-gemini

In such cases, WP Sheet Editor – AI with Google Gemini are your best companion because you can generate posts based on the post titles.

Here are at least three options to do that.

Option 1: Generate post content in the spreadsheet

Let’s see how to generate post content based on the post title using Google Gemini.

The first option is to generate post content directly in the spreadsheet cells. You can run AI prompts in the spreadsheet cells to generate new content or refine existing content.

To do this, go to the Content column, where you have two options to have Gemini AI write your post content based on the title:

  1. You can use a full prompt. Just type ai: followed by the full prompt.
  2. You can use a global prompt shortcut. Just type ai:prompt-slug, replacing “prompt-slug” with the actual slug of your pre-saved global prompt. In this example, we will use ai:write-post to run the prompt we saved as global prompt above.

generate-wordpress-posts-gemini

Once you hit Enter, Gemini will start writing the post content based on the post title. You’ll see a loading icon in the cell while the request is processing.

generate-wordpress-posts-gemini

As you can see, we have generated our first post.

generate-wordpress-posts-gemini

If we go go the cell and click on Edit, we will be able to edit the post using the text editor in a popup.

generate-wordpress-posts-gemini

You can also paste the same prompt or prompt shortcut in multiple cells to generate content for multiple fields and posts at once.

generate-wordpress-posts-gemini

As you can see in the screenshot below, we’re running multiple requests at once.

generate-wordpress-posts-gemini

Once the posts have been written, you can click on Save changes.

generate-wordpress-posts-gemini

Option 2: Generate post content in TinyMCE editors

If you want greater control over the writing process, you can create content for each post separately and directly within the spreadsheet.

This is available if you’re using the classic editor. Simply navigate to the Content column, select Edit in a specific cell or post, and then click Edit with AI.

generate-wordpress-posts-gemini

Now you need to add the prompt text in the Prompt field and click on Generate.

generate-wordpress-posts-gemini

Gemini will begin generating the content. In just a few seconds, your post will be ready, and you can edit it as needed before saving and publishing it on your blog.

generate-wordpress-posts-gemini

Option 3: Bulk generate post content with Gemini AI

Now, let’s see how to generate posts in bulk using Gemini AI. WP Sheet Editor – AI enables you to edit multiple posts at once with its Bulk AI API, which speeds up the processing of AI requests.

In this example, we will search for the posts missing content and generate content for all at once. Let’s start by opening the Search tool.

generate-wordpress-posts-gemini

Now select these values to search for all posts missing content:

  • Tick the Enable advanced filters checkbox.
  • Field: Content
  • Operator: =
  • Value: Leave this field empty.
  • Click on Run search.

generate-wordpress-posts-gemini

After filtering all the posts missing content, you need to open the Bulk Edit tool.

generate-wordpress-posts-gemini

You’ll need to choose these settings to have Gemini AI generate your posts:

  • Select the rows that you want to update: Edit all the rows from my current search.
  • What field do you want to edit: Content
  • Select type of edit: Here you have two options:
    • First option: You can select a pre-saved global prompt. For example, we will select our pre-saved post content prompt, displayed as AI command: Write post. This way, you don’t have to type the prompt.
    • Second option: You can select AI Prompt, and you can paste or type the full prompt.
  • AI Provider: In this example, we will use Google Gemini 2.0 Flash.
  • You can click on Show preview to see the result before saving the changes.
  • Now you can click on Execute Now.

generate-wordpress-posts-gemini

These three options to generate post content based on the post title will help you save a lot of time and write great blog posts with Google Gemini AI.

Optional: Generate post excerpts with Gemini

You can automatically generate post excerpts with Google Gemini AI by using a simple prompt like this:

Summarize the $Content$ in 30 words.

You can save it as a global prompt, or add it in spreadsheet cells like this:

ai:summarize the $Content$ in 30 words.

Of course, you can change the number of words, or use sentences instead of words.

Optional: Generate featured images with AI

WP Sheet Editor – AI allows you to generate featured images for your posts using OpenAI’s image generation models.

Here’s a tutorial where you can learn how to generate post images.

Do you need help?

You can receive instant help in the live chat during business hours, or you can contact us and we will help you via email.