Add Icons to WordPress Menu Without a Plugin

A small icon next to each menu item can make your navigation much easier to scan. Visitors recognise a home icon, a shopping cart, or an envelope far faster than they read the words beside them, and icons give a plain text menu a finished, professional look. You do not need a plugin to add them. WordPress already gives you everything you need: menu CSS classes, a label field that accepts HTML, and a functions.php file for loading an icon font.
This guide covers three ways to add icons to your WordPress menu without a plugin. Method 1 uses Font Awesome, an icon font you load with a few lines of code. Method 2 pastes inline SVG directly into the menu label, which needs no extra library at all. Method 3 uses your own uploaded icon images with CSS background images. You will also learn how to build accessible icon only menu items, how icons behave on mobile, and how to keep the whole thing fast.
What Do You Need Before You Add Menu Icons?
Before you start, decide which menu you are changing. This guide is about the front end navigation menu, the links visitors see in your header, footer, or sidebar. It is not about the admin sidebar menu inside the WordPress dashboard, which uses a different system.
You also need a way to add small code snippets. A child theme functions.php file is the safest place, because a parent theme update will wipe out code added directly to the parent theme. If you do not use a child theme, the free Code Snippets plugin lets you add PHP from your dashboard, and you can switch each snippet off just as easily. For the CSS parts of this guide, use the Additional CSS panel under Appearance, then Customize. Our guide on how to add custom CSS in WordPress explains both options in detail if you have not used them before.
Finally, make a quick backup before you edit anything. A typo in functions.php can take your site down, so download a copy of the file first. Our WordPress maintenance checklist for beginners covers backups and the other routine tasks that keep a site safe while you work on it.
How to Add Font Awesome Icons to Your WordPress Menu
Font Awesome is a free icon font with thousands of icons, from a house and a magnifying glass to social media logos and shopping carts. The method has three parts: load the stylesheet, add a CSS class to each menu item, and write a small CSS rule that shows the right icon before the link text.
First, load the Font Awesome stylesheet on your site. Add the following snippet to your child theme functions.php file or to the Code Snippets plugin. It loads the free Font Awesome CSS from a CDN, stylesheet only, so the cost is small.
// Load Font Awesome for menu icons in WordPress
function vtg_load_menu_icons() {
wp_enqueue_style(
'font-awesome',
'https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.2/css/all.min.css'
);
}
add_action( 'wp_enqueue_scripts', 'vtg_load_menu_icons' );
Next, turn on the CSS Classes field, because WordPress hides it by default. Go to Appearance, then Menus, click Screen Options at the top right, and tick the CSS Classes checkbox. Now open any menu item and you will see the new field, where you can type a class name.
Add a class to each menu item you want an icon on. For the Home item, type home-icon in the CSS Classes field, and for the Blog item, type blog-icon. Save the menu when you are done, and remember that the class names must match the CSS rules you write next, character for character.
Now add the CSS that turns each class into a visible icon. The ::before pseudo element inserts content before the link text, and the content value is the Font Awesome code for the icon you want. You can find each code on the Font Awesome website, listed as its Unicode value. The example below adds a house icon to Home and a pencil icon to Blog.
/* Add Font Awesome icons before WordPress menu items */
.menu-item.home-icon a::before {
font-family: "Font Awesome 6 Free";
font-weight: 900;
content: "\f015";
margin-right: 8px;
}
.menu-item.blog-icon a::before {
font-family: "Font Awesome 6 Free";
font-weight: 900;
content: "\f303";
margin-right: 8px;
}
The font-weight of 900 selects the solid style of the icon. For the regular outline style, use a weight of 400. You can also change the icon size and colour in the same rule, for example with font-size: 15px. If you want more control over individual items, our guide on how to add a custom CSS class to a WordPress menu item explains the class system in more depth, including how to style one item differently from the rest. The official navigation menu documentation at developer.wordpress.org explains the menu functions in full if you want to go further.
How to Add Inline SVG Icons to Menu Labels
If you only need a few icons, or you want to avoid loading an entire icon font for a handful of symbols, inline SVG is the lighter option. An SVG is a small piece of code that draws a shape, and you can paste it directly into the Navigation Label field of a menu item.
First, find or draw the SVG you need. You can copy a simple icon from an open source set such as Dashicons or Heroicons, or export one from a design tool. Keep the SVG small, with a viewBox of 0 0 24 24 and a width and height of around 18 pixels. A filled icon with a single colour works best at menu size.
Go to Appearance, then Menus, open the menu item, and click in the Navigation Label field. Paste the SVG code at the start of the label, before the text, then save the menu. The example below is a simple home icon, with the label text Home after it.
<svg width="18" height="18" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M12 3l9 8h-3v9h-5v-6h-2v6H6v-9H3z"/></svg> Home
Two details in that example matter. The fill value currentColor makes the icon take the same colour as the link text, so it matches your theme and changes colour on hover. The aria-hidden attribute tells screen readers to ignore the icon, because it is decoration, not information.
/* Align inline SVG icons inside WordPress menu items */
.menu-item a svg {
vertical-align: middle;
margin-right: 6px;
margin-top: -2px;
}
How to Use Your Own Icon Images with CSS Backgrounds
The third method uses your own images as icons. This is the best choice when your icons are part of your brand, such as a custom logo mark, a hand drawn symbol, or an illustration that no icon font offers. Prepare each icon as a PNG with a transparent background, sized at 48 by 48 pixels so it stays sharp on high resolution screens. Upload the icons to your Media Library and copy each File URL.
Add a CSS class to each menu item, exactly as in Method 1, then write a CSS rule that sets the uploaded image as a background on the link. The background size controls how large the icon appears, and the left padding makes room for it so the text does not overlap the image.
/* Use a custom uploaded image as a WordPress menu icon */
.menu-item.shop-icon a {
background-image: url("https://yoursite.com/wp-content/uploads/shop-icon.png");
background-repeat: no-repeat;
background-position: left center;
background-size: 20px 20px;
padding-left: 30px;
}
Repeat the rule for each item, changing only the class name and the image URL. Keep the icons consistent in size and style, because mixed icon sizes look messy. Note that background images do not scale with the text colour, so test the menu on both light and dark backgrounds before you call it done.
How to Create Icon Only Menu Items That Stay Accessible
Sometimes you want an icon with no visible text at all, such as a search icon or a cart icon in the header. Icon only items look clean, but they create an accessibility problem: a visitor using a screen reader hears nothing useful, because there is no text to read. The fix is the Title Attribute field, which WordPress shows in the menu editor when you tick it in Screen Options.
Open Appearance, then Menus, click Screen Options, and tick Title Attribute. Then type a clear description in the field, such as Search or View Cart. Screen readers announce this text, and sighted visitors see it as a tooltip on hover.
If you hide the visible text with CSS instead, use a method that keeps it readable by screen readers. Move the text off screen with positioning rather than setting display to none, which also removes it from screen readers. The CSS below hides the text visually while keeping it available to assistive technology.
/* Hide menu link text visually but keep it for screen readers */
.menu-item.hide-text a {
font-size: 0;
}
.menu-item.hide-text a::before {
font-size: 18px;
}
How Do Menu Icons Behave on Mobile?
Menu icons usually carry over to the mobile menu automatically, because the mobile menu is the same menu with different styling. The problems show up in the details. A 20 pixel icon that looks balanced on desktop can look cramped on a narrow mobile menu. Open your site on a real phone, not just a resized browser window, and tap through the mobile menu to see how it behaves.
/* Adjust WordPress menu icons on small screens */
@media (max-width: 768px) {
.menu-item a::before {
font-size: 14px;
margin-right: 6px;
}
}
If your menu has dropdowns, test the icon and the toggle together on a phone before you publish the change. Our guide on how to add a dropdown menu in WordPress explains the structure.
How to Keep Menu Icons Fast
Icons are small, but the way you load them can still cost performance. The most common mistake is loading a full icon font when you only use five icons. Font Awesome free CSS is around 100 kilobytes, an extra file on every page. If you only need a few icons, inline SVG is the faster choice, because it adds no extra request at all.
Frequently Asked Questions
Can I add icons to a WordPress menu without a plugin?
Yes. Load Font Awesome with a small snippet and add CSS classes to your menu items, paste inline SVG into the Navigation Label field, or use your own uploaded images as CSS background images. All three need only the menu editor, a little CSS, and optionally a short PHP snippet.
Why is the CSS Classes field missing from my WordPress menu editor?
WordPress hides the CSS Classes field by default. Go to Appearance, then Menus, click Screen Options at the top right, and tick the CSS Classes checkbox. The same panel also controls the Title Attribute field, which you need for accessible icon only menu items.
Why do my menu icons not show on the front of my site?
The most common causes are a class name that does not match the CSS rule, a Font Awesome stylesheet that failed to load, or a caching plugin serving an old page. Check the class spelling first, confirm the stylesheet URL loads, and clear your cache.
Do menu icons slow down my WordPress site?
Not noticeably if you choose the right method. Inline SVG adds no extra file request, so it is the fastest option for a few icons. Font Awesome adds one stylesheet of around 100 kilobytes. Keep image icons small, under 10 kilobytes each.
Last updated: November 2026.



