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 <article> tag as a standalone page, even when there is only one <article> 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 <article> tag with a <div> or <section> 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 <div> or <section> tag as a replacement for the original tag (while preserving original attributes) might be an option.

CommentFileSizeAuthor
Screenshot 2025-07-12 at 22.21.24.png89.58 KBborisr

Issue fork yoast_seo-3535659

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

borisr created an issue. See original summary.

borisr’s picture

Issue summary: View changes
borisr’s picture

Issue summary: View changes

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.

borisr’s picture

Assigned: borisr » Unassigned
Status: Active » Needs review