Search by

vectorbross / vb_ai_seo_meta

vectorbross

Adds AI buttons to generate the SEO title and meta description on content types that have SEO fields.

Package info

bitbucket.org/vectorbross/vb_ai_seo_meta

Type:drupal-recipe

pkg:composer/vectorbross/vb_ai_seo_meta

Statistics

Installs: 0

Dependents: 0

Suggesters: 0

dev-master 2026-11-27 11:20 UTC

This package is not auto-updated.

Last update: 2026-12-03 22:02:28 UTC


README

Adds AI generated SEO titles and meta descriptions on top of vb_ai_core. Content managers get a Generate SEO title and a Generate SEO description button under the SEO fields. The field is filled with a suggestion based on the page content, which they can edit before saving.

The buttons are only added to content types that have the SEO fields. Content types without them are left alone.

What it installs

ModulePurpose
field_widget_actionsShows the generate button under the field
ai_automatorsRuns the prompt (part of drupal/ai)
maxlengthCharacter counter under the field
vb_ai_widget_actionsConfig action that adds the button only where the field exists

It also applies vb_ai_core (ai, key, token) first.

What it configures

Buttons per content type

Field on the content typeButtonCounter
field_seo_titleGenerate SEO title60 chars
field_seo_descriptionGenerate SEO description155 chars

A content type gets a button when:

  • it has the field with exactly this machine name;
  • the field is a Text (plain), Text (plain, long), Text (formatted) or Text (formatted, long) field;
  • the field is visible on the default form display with a normal text field or text area widget.

In every other case the content type is skipped. Fields skipped because of an unsupported type or widget are logged in the vb_ai_widget_actions channel in Recent log messages.

For each content type with an SEO field, the recipe creates an AI Automator (node.<type>.field_seo_title.default) and adds the button and the counter to the form display. The automator only runs when the button is clicked, never on save.

What the AI reads

The AI gets the first of these fields that exists on the content type: body, field_body, field_intro. If none exists, it gets the node title. It reads the values in the form, so unsaved changes are included.

Prompts

SettingValueEffect
Languagepage languageThe title and description match the page content
Titlemax 60 charsMain topic first, no site name, quotes or emoji
Description120–155 charsSummary with the topic once and a call to action
Countersoft limitWarns when the text is too long, does not block saving
ai_providerdefaultThe default chat provider and model are used

Requirements

  • Drupal 11.4+
  • Drush 13+
  • The project setup from vb_ai_core (composer/installers 2.3+, the recipes/{$name} installer path and the VB repositories entry)
  • A chat capable provider recipe, already required and applied, for example vb_ai_provider_anthropic. The provider recipe sets the default for the chat operation, which the buttons use.
  • The SEO fields on the content types. This recipe does not create them.

Install

Require the recipe. Composer pulls in drupal/ai, drupal/field_widget_actions, drupal/maxlength, vb_ai_widget_actions and vb_ai_core as dependencies.

ddev composer require vectorbross/vb_ai_seo_meta

Apply the recipe

Make sure a provider recipe has been applied first (see Requirements). Run from the project root; Drush runs from the web docroot, so the path starts with ../recipes.

ddev drush recipe ../recipes/vb_ai_seo_meta
ddev drush cr

Content types added later

Add the SEO fields to the new content type, then apply the recipe again. It only adds what is missing: existing buttons, prompts and counters are kept, also when they were changed for the project.

Permissions

The buttons are only shown to users with the Use AI generate buttons permission (from vb_ai_widget_actions). The recipe grants it to the webmaster role and creates that role if it does not exist yet. The administrator role already has every permission. Other roles, such as content editors, do not see the buttons; grant the permission manually if another role needs them.

The permission covers every AI Automator button, so it also applies to the buttons of the other VB AI recipes that use vb_ai_widget_actions.

Verify

ddev drush pm:list --status=enabled --filter=field_widget_actions
ddev drush config:get ai_automators.ai_automator.node.article.field_seo_title.default rule

Then edit a node of a content type with field_seo_title, fill in the body and click Generate SEO title under the field. The field is filled by the default chat provider.

Options

  • Change a prompt for one project at Structure → Content types → (type) → Manage fields: edit the SEO field and change the prompt under AI Automator. Re-applying the recipe does not overwrite it.
  • Change the prompts, counters or context fields for all projects in recipe.yml (addAiGenerateButton). This only affects content types that did not get a button yet.
  • To let editors refine the result in a dialog before inserting it, set enable_refinement: true per field in recipe.yml.
  • This recipe only fills the fields. To use them as <title> and meta description, configure Metatag (or the theme) per project, for example [node:field_seo_title] as the page title for the content types that have the field.

License

GPL-2.0-or-later. See LICENSE.txt.