How to Create and Implement a Custom Icon Font
![]()
Icons used to be added to websites as bitmap images (most often PNG files with a transparent background), and later as vectors (SVG). Today, you can easily create your own icon font from an SVG image, making the icon simple to customize with CSS.
In this article, we will show you how to create a custom icon as a font (Icon Font).
What Is an Icon Font?
An Icon Font is essentially a font made up of images. Displaying an icon through a font is no different from using a font for headings and text. Using a custom icon as a font has many advantages:
- The icon scales without losing quality;
- there is no need to handle Retina displays separately;
- it is easy to customize with CSS (color, size, gradient, shadow and so on);
- you can reuse a single icon with different colors, sizes or spacing;
- an Icon Font loads faster than SVG.
However, there are also disadvantages. For example, differences between browsers can lead to different rendering and slight differences in appearance.
Icons
Before you start creating your own font, you need to prepare icons in SVG (Scalable Vector Graphics) format. You can design your own icons or download them from libraries such as FontAwesome or Google Icons.

Creating Your Own Icon Font
Once all your icons are ready, you can start creating the icon font itself.
The process is very simple because online tools are available for the task. These include icomoon and Fontello.
In this tutorial, we will continue using icomoon.
Step 1: Upload the icons to the tool and create your own collection.

Step 2: Select the icons you want to include in your custom font.

Step 3: Generate the font.

Step 4: Rename the icons and optionally define Unicode characters.

Step 5: Download the generated font.

Implementing the Font in a WordPress Theme
The downloaded ZIP archive contains several prepared files, including CSS styles and font files in the fonts folder.
The best way to implement it in a theme is to use a child theme.
Step 1: Copy the fonts folder from the extracted ZIP archive to the child theme directory (wp-content / themes / [childthemefolder]) over FTP.

Step 2: Insert the following code into style.css in the child theme.
@font-face {
font-family: 'icomoon';
src: url('./fonts/icomoon.eot?5kiojs');
src: url('./fonts/icomoon.eot?5kiojs#iefix') format('embedded-opentype'),
url('./fonts/icomoon.ttf?5kiojs') format('truetype'),
url('./fonts/icomoon.woff?5kiojs') format('woff'),
url('./fonts/icomoon.svg?5kiojs#icomoon') format('svg');
font-weight: normal;
font-style: normal;
}
Step 3: Use in HTML.
You can insert the icon using the following HTML code:
˂span class="icon-toret">˂/span>
The “icon-Toret” class is generated from the icon name specified when generating the font. You therefore need to adjust it to match your own settings if necessary. If you are unsure, check the styles in the folder downloaded from iconmoon.
The associated class for styling is:
.icon-toret:before {
content: "\e900";
color: #9ea3a8;
}
An example of styling this icon could then look like this:
.icon-toret:before {
content: "61";
color: #c0dfe8;
font-size: 72px;
margin-bottom: 24px;
}
.icon-write:hover::before {
color: #000000;
}
A practical example where we used the generated icon in our WooCommerce plugins.











