PHPackages                             elektrorl/metatag\_ai\_generate - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. elektrorl/metatag\_ai\_generate

ActiveDrupal-module[Utility &amp; Helpers](/categories/utility)

elektrorl/metatag\_ai\_generate
===============================

AI-powered SEO meta description generator for Drupal using the AI module framework

v1.0.1(3mo ago)10GPL-2.0-or-laterPHPPHP &gt;=8.1CI passing

Since Feb 3Pushed 3mo agoCompare

[ Source](https://github.com/elektrorl/metatag_ai_generate)[ Packagist](https://packagist.org/packages/elektrorl/metatag_ai_generate)[ Docs](https://github.com/elektrorl/metatag_ai_generate)[ RSS](/packages/elektrorl-metatag-ai-generate/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (5)Versions (3)Used By (0)

Metatag AI Generate
===================

[](#metatag-ai-generate)

### AI-Powered SEO Meta Description Generator for Drupal

[](#ai-powered-seo-meta-description-generator-for-drupal)

*Automatically generate optimized meta descriptions using cutting-edge AI models directly from your Drupal content editor*

[![Drupal](https://camo.githubusercontent.com/44cf1cc5f90e774af237112ae69f4c0da4dc5b420c0eb4923e2ffe673e55298a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f44727570616c2d31302e3225324225323025374325323031312d3036373842453f7374796c653d666f722d7468652d6261646765266c6f676f3d64727570616c266c6f676f436f6c6f723d7768697465)](https://www.drupal.org)[![PHP](https://camo.githubusercontent.com/0b828fae3809f5692b3303526d43b126732078cc61f176b8f877332096c98bc0/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e312532422d3737374242343f7374796c653d666f722d7468652d6261646765266c6f676f3d706870266c6f676f436f6c6f723d7768697465)](https://www.php.net)[![License](https://camo.githubusercontent.com/0b4cd78c4111c47bbb10844afcda579d633769f55bfd776c2bf42eab39825a18/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d47504c2d2d322e302b2d677265656e3f7374796c653d666f722d7468652d6261646765)](LICENSE)

[Features](#features) • [Installation](#installation) • [Configuration](#configuration) • [Usage](#usage) • [Troubleshooting](#troubleshooting) • [Multilingual Support](#multilingual-support)

---

Why Metatag AI Generate?
------------------------

[](#why-metatag-ai-generate)

Writing compelling, SEO-optimized meta descriptions is time-consuming and requires expertise. **Metatag AI Generate** eliminates this burden by intelligently analyzing your content and generating professional meta descriptions in seconds.

There is another similar module called [Metatag AI](https://www.drupal.org/project/metatag_ai).

**Metatag AI Generate**:

- **Manual generation**: You click a "Generate with AI" button when YOU want
- **Scope**: Generates ONLY meta descriptions (not titles)
- **Control**: Full control - generate, review, edit before saving
- **Personas**: Customizable AI writing style per site
- **Bundle-specific**: Enable only for specific content types

**Choose this module if you want:**

- More control over the generation process
- To review and edit AI suggestions before saving
- To generate only descriptions (keep manual titles)
- To customize the AI writing style

**Choose Metatag AI if you want:**

- Fully automatic generation on save
- Both titles and descriptions generated together

### Key Features

[](#key-features)

- **Lightning Fast**: Generate SEO-optimized descriptions in under 2 seconds
- **Smart Content Analysis**: Automatically extracts and analyzes content from rendered node output
- **Multi-Provider Support**: Works with Anthropic Claude, Mistral AI, OpenRouter, OpenAI, and more
- **Customizable Personas**: Define your writing style (professional, creative, technical, etc.)
- **SEO-Compliant**: Generates 155-200 character descriptions with key information front-loaded in the first 160 characters
- **Bundle-Specific**: Enable only for content types that need it
- **Secure**: API keys managed through Drupal's Key module

---

Installation
------------

[](#installation)

### Step 1: Install Required Modules

[](#step-1-install-required-modules)

1. **Via Composer** (recommended):

    ```
    composer require drupal/metatag drupal/ai drupal/key
    composer require drupal/metatag_ai_generate
    ```
2. **Or download manually** from Drupal.org

### Step 2: Enable the Modules

[](#step-2-enable-the-modules)

1. Go to **Extend** (`/admin/modules`)
2. Search for **"Metatag AI Generate"**
3. Check the box and click **Install**

Or use command line:

```
drush en metatag_ai_generate -y
```

### Step 3: Install an AI Provider &amp; Get API Key

[](#step-3-install-an-ai-provider--get-api-key)

Choose one provider and install its Drupal module:

1. **Install the provider module** via Composer:

```
# Anthropic Claude
composer require drupal/ai_provider_anthropic

# Mistral AI
composer require drupal/ai_provider_mistral

# OpenRouter
composer require drupal/ai_provider_openrouter

# OpenAI
composer require drupal/ai_provider_openai
```

2. **Get an API key** from your chosen provider:
    - **Anthropic Claude**: [console.anthropic.com](https://console.anthropic.com/)
    - **Mistral AI**: [console.mistral.ai](https://console.mistral.ai/)
    - **OpenRouter**: [openrouter.ai](https://openrouter.ai/) (access to 100+ models)
    - **OpenAI**: [platform.openai.com](https://platform.openai.com/)

---

Configuration
-------------

[](#configuration)

### Configure API Key

[](#configure-api-key)

1. Go to **Configuration** → **System** → **Keys** (`/admin/config/system/keys`)
2. Click **+ Add key**
3. Fill in:
    - **Key name**: `anthropic_api_key` (or your provider name)
    - **Key type**: Authentication
    - **Key provider**: Configuration
    - **Key value**: Paste your API key
4. Click **Save**

### Configure Metatag AI Generate

[](#configure-metatag-ai-generate)

Navigate to: **Configuration** → **Search and metadata** → **Metatag AI Generate**(`/admin/config/search/metatag-ai-generate`)

**Setting****What to do****Enable Module**Check to activate AI generation**AI Provider**Select your provider (Anthropic, Mistral, OpenRouter, or OpenAI)**API Key**Select the key you created above**Persona**Define your writing style, e.g.:
• `"a professional content writer specializing in SEO"`
• `"a creative copywriter focused on user engagement"`
• `"an e-commerce content specialist"`**Enabled Content Types**Check content types where you want AI generation (e.g., Article, Page)Click **Save configuration**

---

Usage
-----

[](#usage)

### Generate Meta Descriptions

[](#generate-meta-descriptions)

1. **Create or edit content** (e.g., an Article or Page)
2. **Scroll to the Metatag section** (usually in the right sidebar)
3. **Click the "Generate with AI" button**
4. **Wait 1-2 seconds** while AI analyzes your content
5. **Review the generated description** in the Description field
6. **Edit if needed**, then click **Save**

That's it! Your content now has an SEO-optimized meta description.

### How It Works

[](#how-it-works)

**Content Extraction:**

- The module renders your node in "full" view mode
- Extracts plain text from the rendered output (max 5000 characters)
- Includes all visible content: title, body, custom fields, and any displayed data
- Strips HTML tags and normalizes whitespace

**AI Generation:**

- Sends the extracted content to your configured AI provider
- Uses your custom persona to set the writing style
- Generates descriptions between **155-200 characters**
- **Front-loads** the most important information in the first **160 characters** (guaranteed visible on all devices)
- Characters 161-200 can add additional context (may be truncated on mobile)

**Best Practice (2026):**

- Google displays approximately 155-160 characters on all devices
- Up to 200 characters accepted for additional context
- Always put key information first for maximum visibility

---

Troubleshooting
---------------

[](#troubleshooting)

### "Generate with AI" button doesn't appear

[](#generate-with-ai-button-doesnt-appear)

**Solution:**

1. Go to **Configuration** → **Search and metadata** → **Metatag AI Generate**
2. Check that the module is **enabled** (checkbox at top)
3. Check that your content type is selected in **Enabled Content Types**
4. Clear Drupal cache: **Configuration** → **Development** → **Performance** → **Clear all caches**

---

### "No AI provider configured" error

[](#no-ai-provider-configured-error)

**Solution:**

1. Go to **Configuration** → **Search and metadata** → **Metatag AI Generate**
2. Make sure you selected an **AI Provider** from the dropdown
3. Make sure you selected an **API Key** (must be created first in Keys module)
4. Click **Save configuration**

---

### AI generation fails or returns an error

[](#ai-generation-fails-or-returns-an-error)

**Check your API key:**

1. Go to **Configuration** → **System** → **Keys**
2. Edit your API key
3. Make sure the key value is correct (no extra spaces)

**Check your provider's dashboard:**

- Verify your API key is active
- Check you have available credits/quota
- Check for any service outages

**Still not working?**

- Check **Reports** → **Recent log messages** for detailed error messages
- Contact your AI provider's support if the error is on their side

---

Multilingual Support
--------------------

[](#multilingual-support)

Metatag AI Generate is available in **6 languages** with complete professional translations:

LanguageCodeStatus🇬🇧 English`en`✅ Native🇫🇷 Français`fr`✅ Complete🇪🇸 Español`es`✅ Complete🇩🇪 Deutsch`de`✅ Complete🇨🇳 简体中文`zh-hans`✅ Complete🇯🇵 日本語`ja`✅ Complete---

License
-------

[](#license)

This module is licensed under the **GNU General Public License v2.0 or later**.

---

### If you find this module helpful, please star it on GitHub!

[](#if-you-find-this-module-helpful-please-star-it-on-github)

[Report a Bug](https://github.com/elektrorl/metatag_ai_generate/issues) • [Request Feature](https://github.com/elektrorl/metatag_ai_generate/issues) • [Discussions](https://github.com/elektrorl/metatag_ai_generate/discussions)

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance81

Actively maintained with recent releases

Popularity2

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

98d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e53ce6da282cb04a99e80b3d1b6ec7f89905dfd7db096793c44bc7acea52dab8?d=identicon)[elektrorl](/maintainers/elektrorl)

---

Top Contributors

[![elektrorl](https://avatars.githubusercontent.com/u/1575761?v=4)](https://github.com/elektrorl "elektrorl (26 commits)")

---

Tags

aianthropicclaudedrupaldrupal-modulemeta-descriptionmetatagmistralopenrouterseoaidrupalopenaiseoclaudeanthropicOpenRoutermistralmeta descriptionmetatag

### Embed Badge

![Health badge](/badges/elektrorl-metatag-ai-generate/health.svg)

```
[![Health](https://phpackages.com/badges/elektrorl-metatag-ai-generate/health.svg)](https://phpackages.com/packages/elektrorl-metatag-ai-generate)
```

###  Alternatives

[symfony/ai-platform

PHP library for interacting with AI platform provider.

51927.7k136](/packages/symfony-ai-platform)[cognesy/instructor-php

The complete AI toolkit for PHP: unified LLM API, structured outputs, agents, and coding agent control

310107.9k1](/packages/cognesy-instructor-php)[sbsaga/toon

🧠 TOON for Laravel — a compact, human-readable, and token-efficient data format for AI prompts &amp; LLM contexts. Perfect for ChatGPT, Gemini, Claude, Mistral, and OpenAI integrations (JSON ⇄ TOON).

6115.6k](/packages/sbsaga-toon)[llm-agents/agents

LLM Agents PHP SDK - Autonomous Language Model Agents for PHP

16410.9k9](/packages/llm-agents-agents)[soukicz/llm

LLM client with support for cache, tools and async requests

445.6k](/packages/soukicz-llm)[rumenx/php-seo

AI-powered, framework-agnostic PHP package for automated SEO optimization. Intelligently generates meta tags, titles, descriptions, and alt texts using configurable AI providers or manual patterns.

102.0k](/packages/rumenx-php-seo)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
