Real-time SEO for Drupal

Integrates the Yoast SEO analysis library to provide real-time content optimization feedback directly in Drupal's content editing forms.

yoast_seo
23,600 sites
152
drupal.org

Install

Drupal 11, 10, 9, 8 v8.x-2.2
composer require 'drupal/yoast_seo:8.x-2.2'

Overview

Real-time SEO for Drupal brings the powerful Yoast SEO analysis library to Drupal, enabling content editors to optimize their content for search engines in real-time as they write.

The module adds a dedicated SEO field type that can be attached to any content entity (nodes, media, block content, taxonomy terms). When editing content, users see a comprehensive SEO analysis panel that includes a focus keyword field, an overall SEO score indicator, a Google search snippet preview, and detailed content analysis feedback.

The module deeply integrates with the Metatag module, allowing custom SEO titles and descriptions to override metatag defaults. The analysis considers the actual rendered output of the content, ensuring accurate SEO recommendations that reflect how search engines will see the page.

Score status indicators (Good, Okay, Bad, Not available) provide immediate visual feedback on content optimization quality, helping editors understand at a glance whether their content meets SEO best practices.

Features

  • Real-time SEO content analysis with immediate feedback as you edit
  • Focus keyword tracking - specify the main keyword/keyphrase for each page
  • Overall SEO score display with color-coded indicators (Good/Okay/Bad)
  • Google search snippet preview showing how content will appear in search results
  • Optional inline editing of SEO title and meta description within the preview
  • Integration with Metatag module for default title and description templates
  • Support for multiple content entities: nodes, media, block content, and taxonomy terms
  • Configurable theme and view mode for accurate content rendering analysis
  • Auto-refresh option for automatic SEO recalculation on form field changes
  • Field-level access control through dedicated permissions
  • Multilingual support with language-aware analysis

Use Cases

Content editor optimizing articles for search

A content editor creates a new article and wants to ensure it ranks well for 'Drupal migration guide'. They enter 'Drupal migration guide' as the focus keyword in the Real-time SEO widget. The analysis immediately shows areas for improvement: keyword not in title, keyword density too low, meta description missing keyword. Following the recommendations, they update the content and watch the score improve from Bad to Good in real-time.

SEO manager reviewing content quality

An SEO manager can add the SEO score field to Views using the Real-time SEO formatter to create a content audit dashboard. This allows them to quickly identify pages with Bad or Okay scores that need attention, and prioritize SEO improvements across the entire site.

Marketing team controlling search appearance

A marketing team wants precise control over how their landing pages appear in Google search results. By enabling title and description editing in the widget settings, editors can see exactly how the snippet will appear and edit the title and description inline in the preview, seeing changes immediately reflected.

Multi-site agency standardizing SEO practices

A web agency managing multiple Drupal sites can standardize SEO practices by installing Yoast SEO across all sites with consistent configuration. The visual scoring system helps train content editors to follow SEO best practices without needing deep technical knowledge.

E-commerce product page optimization

An e-commerce site adds the yoast_seo field to their product content type. Product managers can ensure each product page is optimized for its target keyword (e.g., 'wireless bluetooth headphones'), improving product visibility in search results and driving organic traffic to product pages.

Tips

  • Always set a focus keyword before expecting meaningful SEO analysis results - this is the baseline for most SEO checks
  • For best analysis accuracy, configure the widget to use the same theme and view mode that your public site uses
  • Enable title editing only when you need to override the metatag title template, as it adds complexity to the editing experience
  • Consider disabling auto-refresh on sites with slow servers or complex content types to improve editing performance
  • The SEO score is stored with the entity, making it possible to create Views and reports showing content SEO quality across the site
  • Ensure the Meta tags and URL alias fields are visible on the form alongside the Real-time SEO field for complete SEO workflow
  • Install either XML Sitemap or Simple XML Sitemap module alongside Yoast SEO for comprehensive SEO coverage

Technical Details

Admin Pages 1
Real-time SEO /admin/config/yoast_seo

Configure global settings for the Real-time SEO module, including sitemap integration guidance and auto-refresh behavior.

Permissions 2
Administer Real-time SEO for Drupal

Control the main settings pages and configure the settings per content types. This is a restricted permission.

Use Real-time SEO for Drupal

Modify Real-time SEO for Drupal configuration per individual entities, including setting focus keywords and editing SEO titles/descriptions.

Hooks 1
hook_metatags_alter

Allows the Yoast SEO module to override metatag title and description values with custom values stored in the yoast_seo field.

Drush Commands 1
drush ypu

Prepares the Yoast SEO module for uninstallation by removing field data. Must be run before the module can be uninstalled.

Troubleshooting 6
The Real-time SEO widget doesn't appear on the edit form

Ensure the yoast_seo field is enabled in 'Manage form display' for your content type. Also verify that the current user has the 'use yoast seo' or 'administer yoast seo' permission.

Error: RealTimeSEO is not defined

The RTSEO.js library is not installed or not found. Download from https://github.com/goalgorilla/RTSEO.js and install to /libraries/rtseo.js/dist/ directory.

SEO analysis never updates or shows loading animation indefinitely

Check if 'auto_refresh_seo_result' is enabled in settings. If disabled, you must click the 'Seo preview' button to trigger analysis. Also ensure there are no JavaScript errors in the browser console.

Cannot uninstall the module

Run 'drush ypu' command to prepare the module for uninstallation before attempting to disable it. This removes field data that would otherwise block uninstallation.

Custom title and description values not appearing in rendered page

Ensure the entity has values saved in the yoast_seo field and that hook_metatags_alter() is being called. The override only happens if the field has non-empty values for title/description.

SEO score shows 'Not available' even after entering focus keyword

The content needs to be analyzed first. Click the 'Seo preview' button to trigger analysis, or enable auto-refresh in settings. Ensure the content body has sufficient text for analysis.

Security Notes 3
  • The 'administer yoast seo' permission is marked as restricted access and should only be granted to trusted administrators
  • Field access is controlled via permissions - users without 'use yoast seo' or 'administer yoast seo' permission cannot view or edit the yoast_seo field
  • The module renders entity previews using Drupal's renderer service, respecting normal access controls and sanitization