WordPress 7.1 keeps the toolbar available across supported client-side navigation. A plugin may clean up DOM nodes but retain subscriptions to editor data stores, route observers, or callbacks that close over previous screen state. Users see one menu while each route change triggers more work, requests, notices, or memory retention.
Use this for toolbar extensions, editor side panels, preview controls, analytics widgets, support launchers, environment badges, notices, and plugins that subscribe to WordPress data stores.
Quick answer
Instrument each owned subscription with a stable feature name, route, creation time, callback count, unsubscribe result, and current generation. Run a fixed navigation loop from posts list to Block Editor, Site Editor, front end, and back at least 20 times. Track active subscriptions, callback invocations per state change, detached nodes, heap after warm-up, timers, observers, requests, and stale-generation work. Alert when active subscriptions exceed the documented constant, one state change invokes more callbacks after each loop, or an old route generation issues a request. The fix is lifecycle ownership and verified unsubscribe behavior, not hiding duplicate output.
Test scenarios to run
Run the same controlled fixture across these branches. Write down the expected result before testing so a surprising response is easy to identify.
| Scenario | Fixture | Expected result |
| Warm-up | 3 route loops | Stable subscription count |
| Sustained | 20 route loops | One callback per state change |
| Failure | Rejected request | No old-generation retry |
| Resume | Sleeping tab wakes | No duplicate subscription |
Diagnostic table
Use this table to connect the observed behavior to evidence and a verification step.
| Action | Evidence | Verification |
| Name every subscription owner | Record WordPress, Gutenberg, browser, theme, plugin versions, toolbar features, subscribed stores, selectors, routes, modal portals, request clients, and the exact loop timing. | Twenty route loops keep subscription and callback counts bounded. |
| Instrument create and cleanup | Wrap subscription creation and cleanup in development instrumentation that records feature, generation, route, callback count, stack, created time, and unsubscribe completion without personal data. | Old route generations cannot issue requests or notices. |
| Run a fixed long-session loop | Capture active subscriptions, invocations per controlled store update, JS heap, detached nodes, listeners, observers, timers, network requests, and console warnings after every route loop. | Detached nodes, timers, observers, and heap stabilize. |
| Reject stale generations | Test direct navigation, client navigation, browser Back and Forward, modal open and close, post switch, Site Editor switch, permission change, failed request, and tab sleep and resume. | Back, Forward, modal, permission, failure, and resume paths pass. |
What to check first
- Record WordPress, Gutenberg, browser, theme, plugin versions, toolbar features, subscribed stores, selectors, routes, modal portals, request clients, and the exact loop timing.
- Wrap subscription creation and cleanup in development instrumentation that records feature, generation, route, callback count, stack, created time, and unsubscribe completion without personal data.
- Capture active subscriptions, invocations per controlled store update, JS heap, detached nodes, listeners, observers, timers, network requests, and console warnings after every route loop.
- Test direct navigation, client navigation, browser Back and Forward, modal open and close, post switch, Site Editor switch, permission change, failed request, and tab sleep and resume.
- Set thresholds after warm-up, make cleanup idempotent, reject stale generations before network work, and run the same 20-loop test in CI or a release canary.
Field notes
- Write the expected result before changing anything and keep one repeatable synthetic fixture for the full test window.
- Record exact versions and UTC timestamps because caches, retries, scheduled actions, and deployments can change the evidence between checks.
- Test the public path and the stored server-side result, not only an admin preview, isolated command, or API response.
- Review the result again after the relevant cache, queue, cron, webhook, and observation window has completed.
Useful command or data shape
Adapt paths, IDs, and privacy handling to the site before running commands or storing data on production.
feature,route,generation,active,callbacks,stale_requests,heap_mb
toolbar-help,/post/41,1,1,1,0,118
toolbar-help,/site-editor,2,1,1,0,121
toolbar-help,/post/52,20,1,1,0,123
Why this usually happens
- The unsubscribe function is stored in a component instance that no longer owns the toolbar.
- A route observer creates a new store subscription before cleaning up the prior generation.
- A callback closes over editor state and remains reachable after its screen ends.
- Cleanup runs twice and throws, leaving later resources active.
Decision rule
Ship only when active subscriptions stay at the documented constant, one controlled update creates one callback, stale routes make no requests, and memory reaches a bounded range after warm-up.
Production verification checklist
- Twenty route loops keep subscription and callback counts bounded.
- Old route generations cannot issue requests or notices.
- Detached nodes, timers, observers, and heap stabilize.
- Back, Forward, modal, permission, failure, and resume paths pass.
Safe fix order
Use a sequence that makes each result easy to prove. Stop when new evidence changes the scope or owner of the problem.
- Name every subscription owner
- Instrument create and cleanup
- Run a fixed long-session loop
- Reject stale generations
- Alert on bounded thresholds
Mistakes to avoid
- Changing production before recording exact versions, UTC timestamps, a stable fixture, the expected result, and a tested rollback point.
- Treating one successful screen as proof while logs, stored records, background jobs, caches, emails, APIs, and downstream systems remain unchecked.
- Testing only as an administrator instead of using the role, device, locale, cache state, request path, and failure branch that users actually reach.
- Leaving debug output, temporary exclusions, helper accounts, duplicate hooks, broad permissions, or relaxed firewall rules active after verification.
Questions teams ask during testing
Can I test this directly in production?
Start with read-only evidence. Use staging for package, code, checkout, form, permission, or cache changes. If a production canary is necessary, make it identifiable, reversible, monitored, and unable to expose personal data or charge a customer.
How do I avoid a false positive?
Repeat the same fixture with the same versions, URL, role, locale, cache state, and downstream integration. Compare the browser result, stored result, and logs instead of relying on one successful screen.
What evidence should I retain?
Keep UTC time, exact versions, request or record ID, expected result, actual result, relevant log lines, change made, rollback point, owner, and final verification. Redact credentials, tokens, and personal data.
When is the work complete?
Close it when the primary path passes, failure branches are understood, stored and downstream records reconcile, temporary changes are removed, monitoring is active, and the owner has the evidence packet.
What to tell the client or owner
Give the owner a concise packet with the affected workflow, exact versions, UTC test time, synthetic fixture ID, expected result, actual result, key logs, change made, rollback point, final result, unresolved risks, owner, and next review date. Remove credentials and personal data before sharing it.
When HandL WP should help
Bring in help when this affects leads, checkout, search visibility, security, paid media reporting, or a client production site. HandL WP can trace the issue through WordPress, hosting, cache, tracking, and Search Console, then verify the workflow after the technical fix.
If this is active on a production site, have HandL WP profile a WordPress toolbar integration.
Related HandL WP guides
Use these related guides when the same issue touches tracking, security, checkout, or crawler visibility.
Helpful references