
WordPress 7.0 introduced the Icon block, but it launched without a public way for developers to register their own icons. That gap is closing in WordPress 7.1 with the new Icon Registration API, which lets plugins and themes register custom icon collections and individual SVG icons that show up directly in the Icon block’s editor UI.
How icon registration works
The API centers on two functions that should be called on the init hook. First, wp_register_icon_collection() registers a named collection using a unique, prefixed slug along with a label and description for the UI. Second, wp_register_icon() registers an individual icon within that collection using a namespaced identifier in the format collection-slug/icon-slug.
Each icon needs a human-readable label plus either inline SVG markup via the content property or a path to an SVG file via file_path. Only one of those two is required, not both.
From code to the block editor
Once registered, a new collection appears as its own tab inside the Icon block’s Icon Library, accessible through the Replace button in the block toolbar. Selecting a custom icon inserts it into the block, where it can be styled with the existing Icon block design tools. The resulting block markup stores the icon using its full namespaced identifier, for example devblog-restaurant/cake, so it works normally in templates and patterns like any other block.
Why it matters for site owners and developers
Before this API, developers wanting custom icons in the block editor had to work around the Icon block’s limitations, since the built in icon list was fixed. With a supported registration path, plugin and theme authors can ship branded or purpose built icon sets (a restaurant menu example is used in the source tutorial) without hacking core functionality.
- Requires WordPress 7.1 or later to use the new functions
- Icons are registered per collection with a namespaced slug format
- SVG content can be provided inline or loaded from a file
- Registered icons appear automatically in the block editor’s Icon Library
For hosting providers and agencies managing client sites, this means custom iconography can now be delivered through standard plugin architecture rather than editor hacks or third party icon plugins, simplifying maintenance once sites are updated to WordPress 7.1.