How to Add Font Awesome to Your WordPress Site
This guide shows you how to add Font Awesome icons to your WordPress site, giving you access to thousands of scalable vector icons for buttons, menus, lists, and more. You’ll learn two reliable methods: using a plugin (easiest) and manually enqueuing the stylesheet (more control). No coding experience is required for the plugin method, but the manual method involves editing your theme’s functions.php file.
What You’ll Need
- A WordPress site with admin access (you’ll need to install plugins or edit theme files).
- An internet connection to download the Font Awesome files or use the CDN.
- For the manual method: a code editor (like Notepad++ or VS Code) and FTP access or the WordPress theme file editor.
Step-by-Step
There are two main ways to add Font Awesome: using a plugin (recommended for beginners) or manually adding the code. Choose the method that best suits your comfort level.
Method 1: Using a Plugin (Easiest)
- Log in to your WordPress admin dashboard. This is usually at
yourdomain.com/wp-admin. - Go to Plugins → Add New. In the search box, type “Font Awesome” and press Enter.
- Choose a plugin. Look for one with good ratings and active installs, such as “Font Awesome” by Font Awesome (the official plugin) or “Better Font Awesome.” Click “Install Now” on the one you prefer.
- Activate the plugin. After installation, click “Activate.”
- Configure the plugin settings (if needed). Most plugins work out of the box. Some may have a settings page where you can choose the Font Awesome version (e.g., 5.x or 6.x) or enable the block editor integration. Check the plugin’s documentation for specifics.
- Start using icons. You can now insert icons in your posts, pages, and widgets. With the block editor, many plugins add a dedicated block or allow you to use an icon shortcode (e.g.,
[icon name="fas fa-home"]). In the classic editor, you can paste the HTML directly, like<i class="fas fa-home"></i>.
Method 2: Manual Enqueue (For More Control)
This method adds Font Awesome to your theme’s header via the functions.php file. It’s a bit more technical but avoids relying on a plugin.
- Get the Font Awesome CDN link. Go to cdnjs.com or the official Font Awesome site and copy the latest version’s CSS link. For example, for version 6.5.2, the link might look like:
https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.2/css/all.min.css(always use the latest version). - Access your theme’s functions.php file. In WordPress admin, go to Appearance → Theme File Editor. On the right side, select
functions.php. Alternatively, use FTP to download the file, edit it locally, and upload it back. - Add the enqueue code. Add the following code to the end of your
functions.phpfile. Replace the URL with the one you copied in step 1.
function add_font_awesome() {
wp_enqueue_style( 'font-awesome', 'https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.2/css/all.min.css', array(), '6.5.2' );
}
add_action( 'wp_enqueue_scripts', 'add_font_awesome' );
- Save the file. Click “Update File” (or upload the edited file via FTP).
- Verify it’s working. Visit your site and view the source code (right-click → View Page Source). Search for “font-awesome” or “fontawesome”. You should see the link to the CSS file.
- Use icons. Now you can use Font Awesome icons anywhere in your theme, posts, or pages. For example, add this to a post or page:
<i class="fas fa-camera"></i>to display a camera icon.
Common Mistakes
- Using the wrong class prefix. Font Awesome 5 and 6 use
fasfor solid icons,farfor regular,fabfor brands. If you copy code from an older version (which usedfa), the icons won’t display correctly. - Forgetting to enqueue the CSS. If you manually add the CSS link directly in your header.php, it may be overwritten by theme updates. Always use the proper
wp_enqueue_stylefunction. - Loading Font Awesome on every page even when you only use icons on one page. This can slow down your site. Consider using a plugin that only loads the necessary icons or use a subsetting service.
- Using the wrong icon name. Font Awesome has thousands of icons. If you use a name that doesn’t exist, nothing will display. Always double-check the icon name on the official website.
Tips
- Use a child theme. If you’re editing
functions.php, always use a child theme so your changes aren’t lost when the parent theme updates. - Leverage the block editor. With the official Font Awesome plugin, you get a block that lets you search and insert icons visually, which is easier than memorizing class names.
- Consider performance. Font Awesome CSS and font files can add ~100KB to your page. If you only need a few icons, consider using an SVG sprite or a subsetting tool to reduce the load.
- Test after updating. After updating your theme or the Font Awesome plugin, check that icons still appear correctly. Sometimes updates can break icon rendering.
Troubleshooting
- Icons not showing at all. First, check if the CSS is loaded. View the page source and search for “font-awesome”. If it’s not there, your enqueue code might be incorrect or the plugin isn’t active. If it is there, check if you’re using the correct class prefix (e.g.,
fasvsfa). - Icons show as empty boxes or squares. This usually means the font file isn’t loading. Check the browser console (F12) for network errors. Ensure the CDN link is correct and accessible. If you’re using a plugin, try deactivating other plugins to see if there’s a conflict.
- Icons work in the editor but not on the front end. This often happens when the theme or a page builder is stripping out the
<i>tags. Try using a different method to insert icons (e.g., a shortcode instead of raw HTML). - Icons appear but are misaligned or too big/small. Add custom CSS to adjust the font-size and vertical alignment. For example,
.fa { font-size: 20px; vertical-align: middle; }. - After updating Font Awesome, icons break. If you were using an older version, the class names may have changed. Check the official migration guide (from 4 to 5, or 5 to 6) and update your icon classes accordingly.
Frequently Asked Questions
Do I need to register for an account to use Font Awesome?
No. The free version of Font Awesome is open-source and can be used without an account. You can load it via CDN or download the files.
Can I use Font Awesome icons in my WordPress menus?
Yes. With the plugin method, you can often assign icons to menu items via the menu editor. If not, you can use a plugin like “Menu Icons” to add icons to your navigation menus.
Will adding Font Awesome slow down my site?
It can, if you load the entire library on every page. To minimize impact, use a plugin that only loads the icons you actually use, or use the manual method with a subsetted version of Font Awesome.
Can I use Font Awesome with page builders like Elementor or WPBakery?
Yes. Most page builders have built-in icon libraries that include Font Awesome, or you can insert the HTML manually in a custom HTML widget.
How do I change the size or color of an icon?
You can use CSS. For example, <i class="fas fa-home" style="font-size: 30px; color: red;"></i> or add a custom CSS class.
What if I only want to use a few icons?
Instead of loading the entire Font Awesome library, you can use an SVG sprite or a tool like Font Awesome’s “Start Using” feature to create a custom kit with only the icons you need.
Related
Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.