Code snippets
How to Remove Custom CSS from an A/B Test
★★★ Technical level 3 of 3
Written by Neil Webley · Last updated
Remove a named test stylesheet without disturbing site styles.
What you need to know
The identifier passed to removeCSS must exactly match the one used by addCSS. Never target a global site stylesheet.
How to use it safely
Use it to remove temporary highlighting or restore a component. Confirm only the intended style element disappears.
Before publishing
- Use Staging to test control and every variant.
- Check matching and non-matching locations.
- Verify mobile, desktop, accessibility and analytics behaviour.
- Ask someone else to review the setup.