Artificial intelligence is steadily moving from experimental add-ons to core enablers of digital operations, and Drupal’s latest update reflects that shift with real clarity. In version 1.2, Content Suggestions becomes part of the natural flow of content creation, giving editors and marketers the ability to shape, refine, and elevate their work without ever stepping outside the form they’re already using.
Setup is simple, and once activated, the suggestions surface exactly where they’re needed, reducing friction and helping teams maintain a consistent voice across large and distributed content ecosystems. Field Widget Actions make this feel effortless, guiding editors to refine copy, improve clarity, or expand ideas without interrupting their focus.
For organisations that require more than out-of-the-box intelligence, Drupal’s architecture opens the door to tailored innovation. Custom Content Suggestion plugins let teams encode their expertise, brand standards, and industry nuance into predictable, reusable logic. With the Prompt field element, those plugins can accept structured inputs, helping editors generate content that aligns with strategic goals and remains grounded in the organisation’s own perspective.
What emerges is a more confident and efficient editorial environment, one that supports scale while keeping quality at the centre. Editors gain momentum, technical leaders gain structure, and the business strengthens its ability to deliver clear, consistent, and high-value digital experiences across every touchpoint.
1. Installing and setting up content suggestions
The Content Suggestions feature is part of the Drupal AI module, available as a submodule that brings AI-powered text generation directly into your content editing forms.
Before proceeding, make sure you’re running Drupal AI 1.2 (or later).
Step-by-step setup
1. Install the AI module
Use Composer to install the Drupal AI module: composer require drupal/ai
2. Enable the required modules
Enable the main AI module and its Content Suggestions submodule: drush en ai ai_content_suggestions
Alternatively, enable AI Content Suggestions from
Extend → AI.
3. Configure your AI provider
Setting up an AI provider (for example, OpenAI, Azure, or Gemini Provider) is a prerequisite before using Content Suggestions.
Go to:
Configuration → AI → Provider settings
Here, you can:
- Select your preferred provider.
- Enter the API key or authentication credentials.
- Set defaults such as model, temperature, and maximum tokens.
Once configured, Drupal will be ready to send generation requests to the selected provider.
4. Configure Content Suggestions
After configuring your provider, navigate to:
Configuration → AI → Content Suggestions settings
This is where you manage and customise all available content suggestion types, such as Suggest title, Summarise text, or Suggest taxonomy tags.
- Enable a suggestion type
- Scroll through the available suggestion plugins.
- Enable one (for example, Suggest title) by toggling its checkbox.

- Customise the prompt
- Each suggestion comes with a predefined prompt that guides the AI.
- You can edit or extend this prompt to better suit your content style.
For example, the default Title Suggestion prompt may read:
“Generate a concise and engaging title for this article.” - You could modify it to:
“Generate an SEO-friendly and curiosity-driven title based on the content below.”
- Using Content Suggestions while editing
Once a suggestion is enabled, editors will see a new “Suggest [field name]” option in the AI Content Suggestions section located in the right-hand sidebar of the content edit form.
When they click the “Suggest title”, “Suggest body”, or other available suggestion buttons, Drupal will generate AI-powered text based on the defined prompt and display the output below the field.
- Control what content is used for generation
Depending on your configuration, AI can generate suggestions based on:
- The entire content of the node (title, body, and other fields), or
- Specific fields only (for example, just the body field).
This allows editors to tailor AI output according to the content structure.

2. Using content suggestions with field widget actions
Normally, content suggestions are generated in a separate interface, requiring you to copy and paste results into the field. That works, but it’s not the most efficient.
This is where Field Widget Actions comes in.
Drupal AI 1.2 solves this with the Field Widget Actions submodule. Once you enable both AI Content Suggestions and Field Widget Actions, a new option appears in the field settings:
- Navigate to:
Structure → Content types → [Your content type] → Manage form display - Edit the field widget:
Click the gear icon next to the field where you want to enable AI suggestions (for example, Title or Body). - Add a content suggestion:
In the widget settings dialog, click “Add content suggestion with prompt.” - Enable suggestions:
Check the box labeled “Enable suggestions.”
This activates the AI suggestion functionality for that field. - Choose your AI model:
From the dropdown, select the AI model you want and in the text area add the prompt (if any). - Save settings:
Click Update and then Save the Manage form display page.

Once enabled, the field displays a button directly next to it (the user can configure the text inside the button, e.g., ‘Generate with AI’). Now, when editors click this button:
- Once the button is clicked, multiple suggestions will be displayed in a modal as shown in the picture below and the editor and select any one of the options.


- The generated content is inserted directly into the field, no copy-paste needed.
- Editors can tweak or overwrite the AI content in real-time, streamlining the workflow.
This integration effectively bridges AI-powered content generation with Drupal’s field management system, letting editors focus on crafting content rather than managing it.
3. Creating a custom content suggestion plugin
While Drupal AI offers several built-in content suggestion plugins (like Title or Body generation), sometimes you need something tailored to your editorial or SEO needs.
For example, marketing teams often want to generate SEO-friendly meta descriptions for their pages, something concise, keyword-optimised, and unique to the content.
Let’s create a custom AI Content Suggestion plugin that generates an SEO-friendly description based on the entire page content.
Use case: Suggesting SEO descriptions with AI
The goal is to build a plugin that:
- Reads all relevant text fields (like title, body, etc.).
- Generates a short, search-optimised meta description (≤160 characters).
- Let's editors trigger AI suggestions directly from the content form.
- Saves and reuses prompt templates so teams can fine-tune their SEO strategy over time.
Implementation Steps:
1. Create a plugin class in your custom module, e.g.,
<?php
namespace Drupal\ai_custom_suggestions\Plugin\AiContentSuggestions;
use Drupal\ai_content_suggestions\AiContentSuggestionsPluginBase;
use Drupal\Core\Form\FormStateInterface;
/**
* Suggests SEO-friendly descriptions for content.
*
* @AiContentSuggestions(
* id = "seo_description",
* label = @Translation("Suggest SEO Description"),
* description = @Translation("Generates an SEO-optimized meta description for content."),
* operation_type = "chat"
* )
*/
class SeoDescription extends AiContentSuggestionsPluginBase {
private string $defaultPrompt = 'Generate an SEO-friendly meta description (max 160 characters) for this page. Return only the description.';
public function updateFormWithResponse(array &$form, FormStateInterface $form_state): void {
$entity = $form_state->getFormObject()->getEntity();
$content = ($entity->get('title')->value ?? '') . "\n" . ($entity->get('body')->value ?? '');
$response = $this->sendChat($this->defaultPrompt . "\n\n" . $content);
$form[$this->getPluginId()]['response']['response']['#context']['response']['response'] = [
'#markup' => $response,
];
}
}
How It Works
- The plugin collects the title and body from the current entity.
- It sends the compiled text to the AI provider using a configurable prompt.
- The AI returns a concise SEO description, which appears directly in the content form.
- Editors can customise the prompt text under
Configuration → AI → Content Suggestions → Suggest SEO Description.

4. Using the prompt library in Plugins
Not all prompts should be a plain textarea. Sometimes, you want a more structured and reusable input experience.
Drupal AI 1.2 introduces the Prompt Library, enabling you to define a collection of predefined prompts that can be reused across various fields and plugins. Using the Prompt Field Element, editors can select a prompt from this library or customise it for the field, ensuring consistency and efficiency in AI interactions.
For example, the Suggest taxonomy tag plugin in AI 1.2 leverages the Prompt Library instead of a plain textarea. Editors can keep multiple prompts handy and easily choose one, without manually overriding defaults every time.
Here's a simplified snippet demonstrating the Prompt Field Element:
$form['prompt'] = [
'#type' => 'ai_prompt',
'#title' => $this->t('AI Prompt'),
'#default_value' => $this->getPrompt(),
];
When used in conjunction with the Prompt Library, this element enhances usability and provides editors with intuitive, structured controls for generating AI-powered content.
Conclusion
The AI Content Suggestions module in Drupal does far more than generate text. It strengthens the entire editorial process by placing intelligence directly inside the tools teams use every day. Getting started is straightforward, and the built-in suggestions offer immediate value for fast, consistent improvements. With Field Widget Actions, editors no longer need to move content back and forth between external tools, allowing AI to write or refine material directly within each field.
For organisations with specialised requirements, custom plugins provide room to encode industry knowledge and brand expectations into repeatable logic. The Prompt field element adds even more precision by introducing structured inputs that guide editors toward results that match strategic goals.
Together, these capabilities give site builders a practical way to support content teams with intelligent assistance at the point of creation. The workflow becomes clearer, the quality becomes more predictable, and teams gain more freedom to focus on ideas rather than mechanics.
The code used in this blog can be found at: Github Link
