[DISCUSSION] WordPress 7.1 is adding a native way to register custom SVG icons - no JavaScript needed
14 August 2026 at 02:46
One of the more exciting features coming in WordPress 7.1 is a public API for custom SVG icons. It finally gives developers a native way to register their own SVG icons and use them across the block editor - without relying on JavaScript workarounds.
What it lets you do:
- Register your own SVG icons using just PHP
- Group them into named collections
- Have them show up in the block editor's icon picker automatically
- Render them server-side in PHP templates
- Pull them through the REST API
No JavaScript. No build tools. Just PHP.
We wrote a guide and built a real plugin to test it on WordPress 7.1's test version, covering:
- Registering icons two ways: inline and from .svg files
- A simple pattern to auto-load a whole folder of icons at once
- Using a custom icon as a block's icon instead of the default Dashicon
Full guide with the working plugin code:
https://wpvibes.com/blog/wordpress-custom-icons/?utm_source=reddit&utm_medium=social
Has anyone else tried this on the test version yet?
[link] [comments]