Which icons have changed
SVGs are now used for the icons of the main sidebar menu items: Dashboard, Posts, Media, Links, Pages, Comments, Appearance, Plugins, Users, Tools, Settings, and the Sites section in Network Admin. The menu collapse button arrow has also been replaced with an SVG. In the admin bar, the default search and site icons, as well as the icons for several nodes—including Edit, Customize, Site Editor, My Sites, and the account—have been switched to built-in SVGs. The changes also affect the WordPress logo, menu toggle, command palette, Add New, Comments, and Updates icons. The WordPress logo is an exception: its icon remains part of the node’s title.
Why some CSS may stop working
Previously, many admin bar and menu icons were rendered using ::before. Now the icon image is a separate SVG element, so rules that style only the pseudo-element no longer control the icon itself. This also applies to color scheme and admin theme styles. For the menu, WordPress maintains compatibility with colors passed through wp_admin_css_color(): if no icon color is specified, the menu text color is used. In the admin bar, styles based on the core _admin.scss already color .ab-icon, so the icon color is preserved in those cases. For other setups, developers may need to apply the color to the icon element. If the color changes on hover, focus, selection, or when open, as well as in mobile rules, those states should also be checked. The SVG inherits the element’s color through currentColor. Hiding the icon with a style for ::before no longer hides the SVG by itself: the new element must also be hidden. Similarly, CSS that replaces the icon with a background image must set the content and dimensions itself if the necessary dimensions were previously provided by the pseudo-element’s content.
How icon overrides have changed
For some admin bar nodes, the icon was previously created as an empty element inside the title. In WordPress 7.2, this element has been removed for most such nodes: the icon is passed separately through the new icon argument. Code that looks for an empty element in the title will no longer find it and will need updating. The WordPress logo node remains an exception. Overriding icons through ::before also depends on where it was applied. For several nodes, including Edit, Customize, Site Editor, My Sites, the site title, and the account, the icon is now in .ab-icon rather than in the ::before of the .ab-item element. A rule that replaces the content only for .ab-item::before will not replace the built-in SVG: the custom symbol will be hidden while the core icon remains visible. In that case, content must also be set for ::before on the icon element. Styles targeting the public-facing search, default site, or menu collapse icons through pseudo-elements should also be redirected to the new elements. To target a menu item by its Dashicons icon, it is now recommended to use the item ID or a class of the menu-icon-* form. Unlike the former Dashicons class, which could match multiple items, these methods target a single item.
What to consider when supporting different versions
The new icon name format for menus is not supported in earlier versions of WordPress. If a plugin needs to support earlier versions while using a custom SVG, pass the new menu name only when the wp_is_valid_icon_name() function is available. The situation is different for an admin bar node: older versions ignore the new icon argument, while WordPress 7.2 hides an empty element left in the title. This makes it possible to use the old Dashicon and the new SVG together in one solution. WordPress 7.2 provides core-admin icon mappings for some Dashicons. Menu icons with such a mapping are replaced automatically. For an admin bar node, the corresponding SVG name must be passed explicitly. If a mapping is added only in a WordPress version after 7.2, use of the new icon must also be restricted by checking that it is registered. The core collection is intended for public-facing site, content, and the “Icon” block icons, not admin icons. Developers of admin interfaces are encouraged to use core-admin or their own collection.