Skip to content

Remove the AI Brand Insights modals from the Yoast SEO installation#23439

Open
JorPV wants to merge 5 commits into
trunkfrom
23431-remove-brand-insights-modal
Open

Remove the AI Brand Insights modals from the Yoast SEO installation#23439
JorPV wants to merge 5 commits into
trunkfrom
23431-remove-brand-insights-modal

Conversation

@JorPV

@JorPV JorPV commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Context

This disables the the "Discover Brand Insights now" modal.

Summary

This PR can be summarized in the following changelog entry:

  • Removes the "Discover Brand Insights now" and "Your first brand analysis is free!" modals that were shown after installing Yoast SEO.

Relevant technical choices:

  • Same pattern as the already-disabled pre-launch modal: both AI_Brand_Insights_Post_Launch::should_show() (Free) and AI_Brand_Insights_Free_Trial::should_show() (Premium) now return false (methods marked @codeCoverageIgnore), mirroring AI_Brand_Insights_Pre_Launch.
  • Both introductions are unregistered from the JS initialize.js component map, their now-obsolete unit tests are removed, and the now-unused modal component files are deleted (including the already-disabled ai-brand-insights-pre-launch, so no dead component files remain).
  • The PHP introduction classes are kept (should_show()false), so their ids stay registered in the collector and the /introductions/{id}/seen REST route keeps validating them. This is deliberate: removing an introduction class would make that id invalid and could break a Premium version that interacts with the introductions system. No DI/constructor change, so no container recompile is needed.

Test instructions

Test instructions for the acceptance test before the PR gets merged

This PR can be acceptance tested by following these steps:

Reset the introductions "seen" state so the modal can show. Reset via the database / WP-CLI (or use a brand-new admin user):

  • WP-CLI: wp user meta delete <admin-login> _yoast_wpseo_introductions
  • or SQL: DELETE FROM wp_usermeta WHERE meta_key = '_yoast_wpseo_introductions' AND user_id = <admin-id>;

This affects two modals: "Discover Brand Insights now" (Free, no Premium subscription) and "Your first brand analysis is free!" (Premium). Test each on the matching setup.

First, on trunk (before this change):

  • After the reset above, go to a Yoast SEO admin page (e.g. Yoast SEO → General).
  • On a Free site, confirm the "Discover Brand Insights now" modal does appear.
  • On a Premium site, confirm the "Your first brand analysis is free!" modal does appear.

Then, on this branch (with the fix):

  • Check out this branch and rebuild the assets (grunt build:dev).
  • Reset the "seen" state again (as above).
  • Reload the Yoast SEO admin page and confirm neither modal appears (Free: "Discover Brand Insights now"; Premium: "Your first brand analysis is free!").
  • Confirm other introductions still behave normally (nothing else regressed).

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:

  • The introductions/announcements shown on Yoast SEO admin pages (the AI Brand Insights post-launch and free-trial modals are affected).

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.
  • This PR also affects Yoast SEO for Google Docs. I have added a changelog entry starting with [yoast-doc-extension], added test instructions for Yoast SEO for Google Docs and attached the Google Docs Add-on 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.
  • I have run grunt build:images and committed the results, if my PR introduces or edits images or SVGs.

Innovation

  • No innovation project is applicable for this PR.

Fixes #23431

…te introduction logic to prevent display on fresh sites.
@JorPV JorPV added changelog: enhancement Needs to be included in the 'Enhancements' category in the changelog and removed changelog: enhancement Needs to be included in the 'Enhancements' category in the changelog labels Jul 9, 2026
@JorPV
JorPV requested a review from Copilot July 9, 2026 09:20
@JorPV JorPV added the changelog: other Needs to be included in the 'Other' category in the changelog label Jul 9, 2026

Copilot AI left a comment

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.

Pull request overview

This PR disables the “Discover Brand Insights now” post-install introduction modal in Yoast SEO to improve the first-run experience on fresh sites, and avoids UI competition with upcoming onboarding flows.

Changes:

  • Disables the PHP introduction by making AI_Brand_Insights_Post_Launch::should_show() always return false (and marks related methods as @codeCoverageIgnore).
  • Unregisters the introduction’s JS modal component from the introductions component map.
  • Removes the now-obsolete unit test for the post-launch introduction.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
tests/Unit/Introductions/Application/AI_Brand_Insights_Post_Launch_Test.php Removes unit tests that are no longer applicable after disabling the introduction.
src/introductions/application/ai-brand-insights-post-launch.php Permanently disables the post-launch introduction via should_show(): false and annotates methods for coverage exclusion.
packages/js/src/introductions/initialize.js Removes the post-launch modal from the JS initialComponents map so it can’t be rendered client-side.

Comment thread src/introductions/application/ai-brand-insights-post-launch.php
Comment on lines 25 to 29
const initialComponents = {
"ai-brand-insights-free-trial": AiBrandInsightsFreeTrial,
"ai-brand-insights-post-launch": AiBrandInsightsPostLaunch,
"black-friday-announcement": BlackFridayAnnouncement,
"delayed-premium-upsell": DelayedPremiumUpsell,
"schema-aggregator-announcement": SchemaAggregatorAnnouncement,

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Keeping it for consistency with the already-disabled ai-brand-insights-pre-launch.js, which is likewise left in place (unreferenced) while its introduction is off. Makes re-enabling trivial and keeps the two AIBI modals symmetric.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Updated: we've now deleted the unused component files (post-launch, free-trial, and the already-disabled pre-launch) as you suggested. The PHP introduction classes are intentionally kept (should_show() => false) so their ids stay registered for the /introductions/{id}/seen route — removing a class, unlike the dead view files, could break a Premium version that interacts with the introductions system.

Disables the Premium "Your first brand analysis is free!" modal the same
way as the post-launch modal, per the UX follow-up on the issue.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@JorPV JorPV changed the title Remove the 'Discover Brand Insights now' modal from the Yoast SEO installation Remove the AI Brand Insights modals from the Yoast SEO installation Jul 9, 2026
JorPV and others added 2 commits July 9, 2026 11:52
Delete the now-unreferenced post-launch and free-trial modal component files
(per PR review). The PHP introduction classes are kept (should_show() => false)
so their ids stay registered in the collector and the introductions "seen"
REST route keeps validating them — this avoids breaking any Premium version
that interacts with the introductions system.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Delete the already-disabled pre-launch modal component too, so no dead
disabled-modal component files remain. Its PHP introduction class is kept
(should_show() => false), matching the post-launch and free-trial handling.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

Copilot AI left a comment

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.

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated no new comments.

@coveralls

coveralls commented Jul 9, 2026

Copy link
Copy Markdown

Coverage Report for CI Build 0

Warning

No base build found for commit 2ee4dc7 on trunk.
Coverage changes can't be calculated without a base build.
If a base build is processing, this comment will update automatically when it completes.

Coverage: 46.425%

Details

  • Patch coverage: No coverable lines changed in this PR.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

Requires a base build to compare against. How to fix this →


Coverage Stats

Coverage Status
Relevant Lines: 62195
Covered Lines: 30246
Line Coverage: 48.63%
Relevant Branches: 12205
Covered Branches: 4294
Branch Coverage: 35.18%
Branches in Coverage %: Yes
Coverage Strength: 8.0 hits per line

💛 - Coveralls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog: other Needs to be included in the 'Other' category in the changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Task]: Remove the ‘Discover Brand insights now’ modal from the Yoast SEO installation

3 participants