Skip to content

Add notification for unused SEO title and description features#22608

Merged
thijsoo merged 18 commits intofeature/adoption-1from
add/alert-for-unused-ai-generate
Oct 3, 2025
Merged

Add notification for unused SEO title and description features#22608
thijsoo merged 18 commits intofeature/adoption-1from
add/alert-for-unused-ai-generate

Conversation

@leonidasmi
Copy link
Copy Markdown
Contributor

@leonidasmi leonidasmi commented Oct 1, 2025

Context

Summary

This PR can be summarized in the following changelog entry:

  • Adds notification for unused SEO title and description features.

Relevant technical choices:

  • There has been a decision on the behavior of the notification, for performance reasons:
    • We check for default SEO data (titles/descriptions) once per day to avoid quering the DB every time an indexable is created/updated, which could be problematic, eg. in the SEOO.
    • We check for non-default SEO data immediately when an indexable is created/updated (so, upon post creation/update), because we want to remove the notification ASAP and there's no heavy query involved there
    • So, the decision for displaying the notification is made one per day, the decision for hiding the notification is made every time a post is created/updated (but also once per day, at minimum)

Test instructions

Test instructions for the acceptance test before the PR gets merged

This PR can be acceptance tested by following these steps:

EDIT: The copies below have changed, you can check #22624 for the final ones.

  • Make the 5 most recently modified posts have default SEO title and meta description
    • Basically make sure that you don't touch the title and description for those posts
    • For devs: With every post updated with default SEO title or description, confirm that its id is added in the default_seo_title or default_seo_meta_desc settings respectively, in the wpseo option
  • Using WP Crontrol, go to Tools->Cron events and trigger the wpseo_detect_default_seo_data scheduled action
  • After a refresh, confirm that you see the alert counter in the top adminbar increased by one
  • Go to Yoast's alert center and confirm that you see an alert saying:

Your posts are using default SEO titles and meta descriptions, which makes them easy to overlook. Catch attention in search with custom titles and descriptions from Yoast AI Generate. Try it for free.

or if you have Premium enabled:

Your recent posts are using default SEO titles and meta descriptions, making them less appealing in search. Create custom titles and descriptions instantly with Yoast AI Generate. Learn how to use it.

  • Go to at least one post and add a custom SEO title
  • Confirm that you dont see the alert counter in the top adminbar change
  • Go to Yoast's alert center and confirm that you see an alert saying:

Your recent posts are using default meta descriptions, which makes them easy to overlook. Catch attention in search with custom titles and descriptions from Yoast AI Generate. Try it for free.

or if you have Premium enabled:

Your recent posts are using default meta descriptions, making them less appealing in search. Create custom titles and descriptions instantly with Yoast AI Generate. Learn how to use it.

  • Revert that post's title back to the default and this time add a custom meta description
  • Using WP Crontrol, go to Tools->Cron events and trigger the wpseo_detect_default_seo_data scheduled action
  • Go to Yoast's alert center and confirm that you see an alert saying:

Your recent posts are using default SEO titles, which makes them easy to overlook. Catch attention in search with custom titles and descriptions from Yoast AI Generate. Try it for free.

or if you have Premium enabled:

Your recent posts are using default SEO titles, making them less appealing in search. Create custom titles and descriptions instantly with Yoast AI Generate. Learn how to use it.

  • Go to another post and add a custom SEO title there
  • Confirm that you see the alert counter in the top adminbar decreased by one
  • Go to Yoast's alert center and confirm that you dont see any relevant alerts.

Other cases:

  • We're always checking the 5 most recently modified PUBLIC posts, to check for default SEO titles/descriptions
    • This means you can test around that part, like:
      • have only the most recently modified post with non-default SEO data and the rest of your post with default SEO data, which means you get no notification.
      • Trash/noindex/draft/etc that most recent post
      • you should be getting the notification again (after you run the scheduled action)
  • We disable this alert when in the global Yoast settings we have toggled off either Show posts in search results or Enable SEO controls and assessments. So, if you have a notification active and then disable either one of those settings, we will no longer show that notification.
  • When indexables are disabled, we never show the notification, since there's no way to resolve the issue, as we use indexables to detect default SEO titles/descriptions
    • Use add_filter( 'Yoast\WP\SEO\should_index_indexables', '__return_false' ); to confirm that you never see the notification when you have disabled indexables.
  • Test with having less than 5 (public) posts too. In that case, we should never get a notification.
  • Deactivate the Free plugin, go to Tools->Cron events and confirm that there's no wpseo_detect_default_seo_data action there anymore.

Relevant test scenarios

  • Changes should be tested with the browser console open
  • Changes should be tested on different posts/pages/taxonomies/custom post types/custom taxonomies
  • Changes should be tested on different editors (Default Block/Gutenberg/Classic/Elementor/other)
  • Changes should be tested on different browsers
  • Changes should be tested on multisite

Test instructions for QA when the code is in the RC

  • QA should use the same steps as above.

Impact check

This PR affects the following parts of the plugin, which may require extra testing:

  • Run the SEOO and confirm things are going smooth as before.

Other environments

  • This PR also affects Shopify. I have added a changelog entry starting with [shopify-seo], added test instructions for Shopify and attached the Shopify label to this PR.

Documentation

  • I have written documentation for this change. For example, comments in the Relevant technical choices, comments in the code, documentation on Confluence / shared Google Drive / Yoast developer portal, or other.

Quality assurance

  • I have tested this code to the best of my abilities.
  • During testing, I had activated all plugins that Yoast SEO provides integrations for.
  • I have added unit tests to verify the code works as intended.
  • If any part of the code is behind a feature flag, my test instructions also cover cases where the feature flag is switched off.
  • I have written this PR in accordance with my team's definition of done.
  • I have checked that the base branch is correctly set.

Innovation

  • No innovation project is applicable for this PR.
  • This PR falls under an innovation project. I have attached the innovation label.
  • I have added my hours to the WBSO document.

Fixes #

@leonidasmi leonidasmi added the changelog: non-user-facing Needs to be included in the 'Non-userfacing' category in the changelog label Oct 1, 2025
@coveralls
Copy link
Copy Markdown

coveralls commented Oct 1, 2025

Pull Request Test Coverage Report for Build 0f55b8f98ead4f18264db5c94e406b0c1609c4ee

Details

  • 56 of 79 (70.89%) changed or added relevant lines in 5 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.4%) to 52.771%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/alerts/application/default-seo-data/default-seo-data-alert.php 47 48 97.92%
src/alerts/user-interface/default-seo-data/default-seo-data-watcher.php 0 22 0.0%
Totals Coverage Status
Change from base Build 52ee80b3ac3925ed07c59dca93065386cbdfc3d2: -0.4%
Covered Lines: 31320
Relevant Lines: 59486

💛 - Coveralls

@leonidasmi leonidasmi changed the base branch from trunk to feature/adoption-1 October 2, 2025 11:24
@leonidasmi leonidasmi added this to the feature/adoption-1 milestone Oct 2, 2025
@leonidasmi leonidasmi marked this pull request as ready for review October 3, 2025 07:09
@thijsoo thijsoo self-assigned this Oct 3, 2025
@leonidasmi leonidasmi mentioned this pull request Oct 3, 2025
17 tasks
Copy link
Copy Markdown
Contributor

@thijsoo thijsoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACC 👍 just some small suggsetions

/**
* Creates a message to inform users that they are using only default SEO data lately.
*
* @param bool $default_seo_titles Whether there are content types with default SEO title in their most recent posts.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would like to suggest maybe a has_... or something naming since I was a bit confused that this was not the actual default seo title or description haha

Comment thread src/alerts/application/default-seo-data/default-seo-data-alert.php
Comment thread src/alerts/application/default-seo-data/default-seo-data-alert.php Outdated
Comment thread src/alerts/application/default-seo-data/default-seo-data-alert.php Outdated
@thijsoo thijsoo assigned leonidasmi and unassigned thijsoo Oct 3, 2025
leonidasmi and others added 6 commits October 3, 2025 12:51
….php

Co-authored-by: Thijs van der Heijden <thijsoo@users.noreply.github.com>
….php

Co-authored-by: Thijs van der Heijden <thijsoo@users.noreply.github.com>
…on-scheduler.php

Co-authored-by: Thijs van der Heijden <thijsoo@users.noreply.github.com>
@leonidasmi leonidasmi assigned thijsoo and unassigned leonidasmi Oct 3, 2025
Copy link
Copy Markdown
Contributor

@thijsoo thijsoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CR + ACC 👍

@thijsoo thijsoo merged commit 992d0ac into feature/adoption-1 Oct 3, 2025
26 checks passed
@thijsoo thijsoo deleted the add/alert-for-unused-ai-generate branch October 3, 2025 12:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog: non-user-facing Needs to be included in the 'Non-userfacing' category in the changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants