While working on Add "Edit with Yoast Bulk Editor" entry to WP admin content-type bulk-actions dropdown - ph2 I came across removable_query_args, which is a WordPress filter that allows you to strip certain arguments from a page URL once the page received it. This allows for cleaner URLs where irrelevant parameters (e.g. parameter that make sense for a single request, or for internal use only) are stripped. Pure cosmetics, but why not? 🙂
Claude identified the following points in our code where this approach could be implemented:
Yoast SEO:
redirected_from_site_kit — src/dashboard/user-interface/setup/setup-flow-interceptor.php:83 redirects to wpseo_dashboard&redirected_from_site_kit; it feeds isRedirectedFromSiteKit (site-kit.php:191), which renders SiteKitRedirectBackAlert in the dashboard widget. Refresh or bookmark keeps showing the "welcome back from Site Kit" alert forever.
2. wpseo_tracked_action + wpseo_tracking_nonce — task-list links carry them (tracking-link-adapter.php); tracking-on-page-load-integration.php fires the tracker on admin_init. They linger, so every refresh re-runs the tracking path and bookmarks/shared URLs embed a tracking action + nonce. Both names would need registering (core's list covers _wpnonce-style params it knows, not custom nonce names).
start-myyoast-connection + _wpnonce — the JS hand-rolls exactly what the filter does: myyoast-integration.js:421 calls removeSearchParam twice + addHistoryState. Registering both params would let core's wp_admin_canonical_url() do it and the custom scrub could go. Caveat: the JS removes them at a deliberate moment (after auto-start kicks off); worth checking the flow tolerates load-time scrubbing before swapping.
install=true (addon-installation dialog, dialog-integration.php:70) — while it's in the URL, every refresh re-busts the MyYoast addon-info cache and reopens the dialog. Scrubbing after first load is arguably the desired UX, but it's a product call (a user who refreshes mid-flow loses the dialog).
from_tools=1 (redirect-integration.php:89 → redirects page) — only switches an upsell link variant (modal-content.js:21).
While working on Add "Edit with Yoast Bulk Editor" entry to WP admin content-type bulk-actions dropdown - ph2 I came across
removable_query_args, which is a WordPress filter that allows you to strip certain arguments from a page URL once the page received it. This allows for cleaner URLs where irrelevant parameters (e.g. parameter that make sense for a single request, or for internal use only) are stripped. Pure cosmetics, but why not? 🙂Claude identified the following points in our code where this approach could be implemented:
Yoast SEO:
redirected_from_site_kit—src/dashboard/user-interface/setup/setup-flow-interceptor.php:83redirects towpseo_dashboard&redirected_from_site_kit; it feedsisRedirectedFromSiteKit(site-kit.php:191), which rendersSiteKitRedirectBackAlertin the dashboard widget. Refresh or bookmark keeps showing the "welcome back from Site Kit" alert forever.2.
wpseo_tracked_action+wpseo_tracking_nonce— task-list links carry them (tracking-link-adapter.php);tracking-on-page-load-integration.phpfires the tracker onadmin_init. They linger, so every refresh re-runs the tracking path and bookmarks/shared URLs embed a tracking action + nonce. Both names would need registering (core's list covers_wpnonce-style paramsit knows, not custom nonce names).start-myyoast-connection+_wpnonce— the JS hand-rolls exactly what the filter does:myyoast-integration.js:421callsremoveSearchParamtwice +addHistoryState. Registering both params would let core'swp_admin_canonical_url()do it and the custom scrub could go. Caveat: the JS removes them at a deliberate moment (after auto-start kicks off); worth checking the flow tolerates load-time scrubbing before swapping.install=true(addon-installationdialog,dialog-integration.php:70) — while it's in the URL, every refresh re-busts the MyYoast addon-info cache and reopens the dialog. Scrubbing after first load is arguably the desired UX, but it's a product call (a user who refreshes mid-flow loses the dialog).from_tools=1(redirect-integration.php:89→ redirects page) — only switches an upsell link variant (modal-content.js:21).