You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Interactivity API: Native anchor links (#) trigger full page reload due to wpInteractivityId mismatch #76447
Since the introduction of session-based history tagging in PR #75927, native anchor/hash links (e.g., <a href="#section">) cause the entire page to reload. Specifically, the issue seems to be with this portion of the PR:
When a user clicks a standard hash link, the browser creates a new history entry. Because this new state does not contain the wpInteractivityId assigned at the start of the session, the popstate listener in @wordpress/interactivity identifies it as a stale session and executes window.location.reload().
Step-by-step reproduction instructions
Use a WordPress site with Gutenberg 22.7.0 enabled
Create a page with long content and a standard HTML anchor link: <a href="#footer">Go to Footer</a>.
Ensure the page also has some block that requires interactivity (Ex: a core/navigation block)
Click the Go to Footer link.
Observed behavior: The page reloads entirely instead of simply scrolling to the ID.
Expected behavior: The browser should navigate to the fragment identifier without a page refresh.
Screenshots, screen recording, code snippet
No response
Environment info
Gutenberg 22.7.0
Wordpress 6.9.4
Exists on Chrome and Brave
Exists on Android and Windows
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes
Please confirm which theme type you used for testing.
I'm not familiar enough with the PR's original goals to submit a fix PR without potentially re-breaking the original problem, but possibly a solution is to only trigger a reload if the hash has not changed or if there's no element with an ID matching the hash?
I can confirm this. This currently breaks my site's "Table of Contents" links (which are #anchor links) and a click instead triggers a page reload.
Commenting out the code block from above restores the desired behavior.
Activity
joshuadwire commentedon Mar 12, 2026
I'm not familiar enough with the PR's original goals to submit a fix PR without potentially re-breaking the original problem, but possibly a solution is to only trigger a reload if the hash has not changed or if there's no element with an ID matching the hash?
TobiasBg commentedon Mar 13, 2026
I can confirm this. This currently breaks my site's "Table of Contents" links (which are
#anchorlinks) and a click instead triggers a page reload.Commenting out the code block from above restores the desired behavior.
DAreRodz commentedon Mar 16, 2026
Good catch, folks! PR #76520 should fix it. 🙂