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
The data-wp-ignore directive is designed to prevent hydrating a specific part of an interactive region. However, the current implementation breaks context inheritance and could cause issues with client-side navigation. Supporting these cases would be complex.
Moreover, it doesn't cover a real use case at this moment, so the best option would be to just remove this directive.
What is your proposed solution?
We can display a warning message when data-wp-ignore is used and remove it in a subsequent WordPress release. Alternatively, it can even be removed directly, as it is not documented and it's improbable that developers are using it.
Hi, @Sahil1617. 👋 If you're willing to work on this issue, the data-wp-ignore implementation is in the /packages/interactivity/src/directives.tsx file.
Are there alternatives to the ignore directive? I saw the deprecation message recently, but it's unclear whether I can do anything about it or where to go for more information. A link to some explanation in the deprecation message would be nice.
+1 on alternatives? A third part script was adding an onClick to the markup on one site, this triggered an error in the interactivity api and data-wp-ignore fixes it, is there a way to get around this now?
Activity
Sahil1617 commentedon Jul 23, 2025
Hi @DAreRodz 👋
Thanks for highlighting this cleanup opportunity.
To start, I plan to:
data-wp-ignoreis currently being processed.Let me know if that sounds good or if there are any additional considerations I should be aware of. Looking forward to contributing!
DAreRodz commentedon Jul 28, 2025
Hi, @Sahil1617. 👋 If you're willing to work on this issue, the
data-wp-ignoreimplementation is in the/packages/interactivity/src/directives.tsxfile.gutenberg/packages/interactivity/src/directives.tsx
Lines 592 to 610 in 166bc58
You can use the
warnfunction, like thedata-wp-contextdirective does, to show a deprecation message to developers:gutenberg/packages/interactivity/src/directives.tsx
Lines 229 to 233 in 166bc58
Sahil1617 commentedon Jul 28, 2025
Thanks for the pointer, @DAreRodz! 🙌
I've located the
data-wp-ignoredirective in/packages/interactivity/src/directives.tsx(lines 592–610), and I plan to:warn()call within the directive to notify developers thatdata-wp-ignoreis deprecated.I'll open a PR shortly with the changes. Please let me know if you'd prefer any adjustments to the messaging or approach.
Looking forward to contributing! 🚀
sirreal commentedon Aug 27, 2025
Are there alternatives to the ignore directive? I saw the deprecation message recently, but it's unclear whether I can do anything about it or where to go for more information. A link to some explanation in the deprecation message would be nice.
emeaguiar commentedon Mar 12, 2026
+1 on alternatives? A third part script was adding an
onClickto the markup on one site, this triggered an error in the interactivity api anddata-wp-ignorefixes it, is there a way to get around this now?luisherranz commentedon Mar 13, 2026
Can you give a more concrete example of the HTML and what is failing?