Enable Navigation Icons
Add icons to Navigation block links and submenus.
Install in
Enable Navigation Icons adds an icon option to the items in the core Navigation block. Select a link or submenu, click Add icon in the block toolbar, and pick an icon. Then set its size, spacing, position and colors for that item, or once on the Navigation block for the whole menu.
Icons are added when the page is rendered, not saved into your content, so your menus stay clean and portable. Deactivate the plugin and the menus go back to plain text links.
Try it in WordPress Playground to test the plugin in your browser, with nothing to install.
Getting started
- Select a menu item. In the Site Editor or the block editor, select a link or submenu inside a Navigation block.
- Add an icon. Click Add icon in the block toolbar and choose from the icon library, paste SVG code, or pick an SVG from the Media Library if your site allows SVG uploads.
- Style the whole menu. Select the Navigation block and set Default Icon Settings in the sidebar: size, spacing, position, label visibility and more. Every item follows them.
- Override where needed. On any item, turn off Use default icon settings to give it its own settings and colors.
Key features
Icons from anywhere
- 297 built-in icons, from WordPress’s own icon set plus social and brand logos, searchable by name and category
- On WordPress 7.1 and later, icons registered with the WordPress Icon API, including core’s icons and any collection added by your theme or another plugin
- Paste your own SVG code, with a live preview
- Pick an SVG from the Media Library, on sites that allow SVG uploads
- Icon sets added with the Icon Block plugin appear in the library too
Layout
- Icon before or after the label
- Icon-only items: hide the label visually while screen readers still announce it, for social links and other compact menus
- Space-between layout for full-width menus
- Top, center or bottom alignment for labels that wrap onto several lines, plus a fine vertical offset
- Icon size and gap in px, em or rem
Style
- Icon color from the theme palette or any custom color
- A separate icon color on hover and keyboard focus
- Rotation in 15 degree steps, and horizontal or vertical flipping
- “No icon fill” for stroke-based icon sets such as Lucide
Menu-wide defaults
- Set every option once on the Navigation block and all of its items follow, including submenu items and menus loaded from a saved Navigation menu
- Items can keep the defaults or use their own settings
- Settings panels work like core’s: common options are shown, the rest are added from the panel menu, and each can be reset on its own
WordPress Icon API (WordPress 7.1+)
On WordPress 7.1 and later the plugin works with core’s SVG Icon API in both directions:
- Icons registered with the Icon API appear in the icon library next to the built-in set
- The built-in set is published as the
enable-navigation-iconscollection, so the core Icon block, other plugins and the REST API can use it too
On WordPress 6.9 and 7.0 everything else works the same, using the icons the plugin ships with.
How icons are stored
An icon picked from a library is stored by name, such as enable-navigation-icons/wordpress-github or core/plus, and turned into SVG when the page is rendered. Only custom SVG code and Media Library uploads are stored as markup, and that markup is sanitized before it is output.
Settings become CSS classes on the menu item, such as has-icon__wordpress-github, has-icon-position__left and has-hidden-label, so themes can target them.
Supported blocks
core/navigation: default icon settings for the whole menucore/navigation-link: menu linkscore/navigation-submenu: submenu itemsollie/mega-menu: dropdown items from the Ollie Menu Designer plugin
Support & Contribute
- Support: ask questions and report problems in the support forum.
- Contribute: the code lives on GitHub. Bug reports and pull requests are welcome in the issue tracker.
Enable Navigation Icons is written and maintained by Trent Stromkins.
Credits
Inspired by, and built on code and ideas from, Enable Button Icons by Nick Diego.
Written by Joobi from the project's own listing. See the source page
1.0.2
Adds icon-only menu items and an icon hover color, and makes the plugin lighter on every page. Existing icons render exactly as before; nothing needs to be migrated.
New
- Hide label (icon only): hide a navigation item’s text visually while screen readers still announce it, so icon-only links such as social profiles stay accessible. Available per item and as a Navigation block default. In the editor the label is shown faded while the item is selected, so it can still be edited.
- Icon hover color: give icons a different color on hover and keyboard focus, per item or as a Navigation block default.
- The icon settings panels now work like core’s block settings: common options are always visible, the rest can be added from the panel menu, every option can be reset on its own, and “Reset all” restores the defaults. Options you have already set are always shown.
Fixes
- Custom stroke-based SVG icons (such as Lucide) no longer disappear on the front end. Their stroke attributes were being removed by the SVG sanitizer, although the editor preview showed them correctly.
- Custom SVG icons with cut-out shapes keep their holes (
fill-ruleis now preserved). - An icon color containing
$followed by a digit no longer corrupts the menu markup. - After a plugin update, browsers now load the updated stylesheet instead of a cached copy (the stylesheet was versioned by the theme’s version).
- The icon stylesheet is printed once per page instead of once per navigation block type.
- No more failed Icon API requests when opening the icon library on WordPress versions without the Icon API.
- No more component deprecation warnings in the editor console on WordPress 6.9 and 7.0.
Performance
- Registering the bundled icons with the WordPress Icon API is about 50 times faster: icons are registered by file and only read and sanitized when used, instead of all ~300 being sanitized on every page load.
- The editor script is about 25% smaller (308 KB to 238 KB): it now uses WordPress’s built-in serializer instead of bundling React’s server renderer, and no longer loads lodash.
Compatibility
- Requires WordPress 6.9 or later (previously 6.3). Tested up to WordPress 7.2.
1.0.1
- Fix the distributed plugin package including the repository’s version control directory, which inflated the download from roughly 170 KB to 916 KB. No functional changes.
1.0.0
First stable release. Adds support for the WordPress Icon API introduced in WordPress 7.1, alongside new rotation and flip controls. Existing icons are unaffected and no migration is required.
WordPress Icon API support (WordPress 7.1+)
- Browse icons registered with core’s SVG Icon API directly in the icon library, including WordPress core’s own icon set and any collection registered by your theme or another plugin
- Icons chosen from a collection are stored by name and rendered on the server, so no SVG markup is written into your post content
- The plugin’s bundled icon set is published as an
enable-navigation-iconsicon collection, making all 297 icons available to the core Icon block, to other plugins, and over the REST API
Cleaner post content on every supported version
- Icons picked from the built-in library are now stored by name and resolved from data the plugin ships with, so post content stays free of SVG markup on WordPress 6.3 and later, not only on 7.1
- Content remains portable between sites running any supported WordPress version
New icon controls
- Rotate icons, in 15 degree steps, per navigation item or as a Navigation block default
- Flip icons horizontally and vertically, matching the core Icon block’s controls and CSS class names
- Rotation and flipping combine correctly, and both work for built-in, custom, and collection icons
Fixes and improvements
- Fix editor interface strings not being translatable: text domains are now correct throughout and JavaScript strings are included in the translation template
- Fix icon size and rotation not applying to the editor preview for icons rendered from a collection
- Only download the icon registry when it is actually needed, rather than on every editor load
- Match the core Icon block’s render model, using the CSS
rotateproperty andbox-sizingon icon SVGs so shared icons render consistently wherever they appear - Two bundled icons that core’s SVG sanitizer could not represent are now published correctly
Compatibility
- Tested with WordPress 7.1
- Requires WordPress 6.3 or later, and continues to run unchanged on 6.3 through 7.0
- Existing navigation icons keep working exactly as before, with no migration and no changes to the CSS classes themes target
0.2.1
- Confirm compatibility with WordPress 7.0
- Update npm dependencies
- Remove legacy WordPress 6.1 fallback code (minimum version is 6.3)
0.2.0
- Add icon vertical alignment option (top, center, bottom) for multi-line menu items
- Add icon vertical offset for fine-tuning icon position (supports px, %, em, rem units)
- Add WordPress Playground support for local development and testing
- Fix icon size and spacing not applying to submenu/dropdown items rendered as button elements
- Update Node.js to 22 LTS and update npm dependencies
0.1.1
- Fix submenu icon not appearing on parent item when children have their own icons
- Fix icon injection for submenu items rendered as button elements (click-to-open mode)
- Fix icon styles leaking from parent submenu into child navigation items in editor and frontend
- Fix block error when adding custom icon to navigation item with no existing icon
0.1.0
- Initial release
- Icon selection (library, media, custom SVG)
- Icon positioning (left/right, space between)
- Icon styling (size, spacing, color, no fill option)
- Navigation block default settings
- Support for core/navigation-link and core/navigation-submenu blocks
- Support for Ollie Menu Designer mega menu blocks
Follow this listing's changes (Atom feed)