SEO warning triggered when content is wrapped in <article>

Created on 12 July 2025, 24 days ago

Problem/Motivation

When adding a link to the page content, the following SEO warning appears:
"You're linking to another page with the focus keyword you want this page to rank for. Consider changing that if you truly want this page to rank."
The warning appears consistently, even when the link points to an external website and is unrelated to the focus keyword.

After some investigation, it seems the analysis treats content wrapped in an tag as a standalone page, even when there is only one tag and it wraps the entire content being analyzed.

Since Drupal's default themes, such as Claro and Olivero, wrap node content in an tag, this warning may appear even when there is no actual keyword conflict.

Replacing the tag with a

or resolves the issue, while the rest of the content remains unchanged.

Note: this issue is a follow up from issue #503405.

Steps to reproduce

1. Create a new node with the following body content:

<h2>Hello world</h2>
<p>This is some content using the word "hello".</p>
<p><a href="https://example.com">Visit example.com</a></p>

2. Set the focus keyword to: "hello"

3. Run the SEO analysis using the default theme (e.g., Claro or Olivero)

Proposed resolution

Remove (or replace) the root-level tag before sending the content for SEO analysis.
This helps avoid warnings caused by the interpretation of the tag as a standalone document.

If replacing is preferred, using a

or element as a replacement for the original tag (while preserving original attributes) might be an option.
🐛 Bug report
Status

Active

Version

2.0

Component

Code

Created by

🇳🇱Netherlands borisr

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @borisr
  • 🇳🇱Netherlands borisr

    After further investigation, it appears that the reported issue only occurs when the rendered output contains no internal links.

    Reproduction / Testing:

    • Using a default Article content type (with "Display author and date information" enabled): issue does not occur.
    • Using a default Page content type (with "Display author and date information" disabled): issue does occur.
    • Using a modified Article content type (with "Display author and date information" disabled): issue does occur.

    Removing the wrapping <article> tag from the rendered output appears to resolve the issue in all tested scenarios and results in the expected SEO score.

  • 🇳🇱Netherlands borisr
Production build 0.71.5 2024