DevelopersJetpack 101

How to Add Custom Fonts to WordPress (Step-by-Step Guide)

two women reviewing fonts on a desktop

Adding a custom font to your WordPress website is a great way to make your site stand out and enhance your brand identity. While WordPress offers a range of default fonts, using a unique font helps you achieve a distinctive look that communicates the feel of your brand. 

Is your business serious and technical or playful and joyous? Maybe your company has a futuristic focus or a retro vibe, like Chia Pet’s WooCommerce store. Custom fonts can communicate these and other nuanced moods to visitors.

Chia Pet uses the aptly named Herbus font for bold headings throughout its website to add a vintage 1970’s feel.
Image source: Chia.com. Chia Pet uses the aptly named Herbus font for bold headings throughout its website to add a vintage 1970’s feel.

If you’re interested in adding a specific font to your WordPress website, there are a few different ways to do it. It can be as easy as choosing a custom Google font in the default WordPress settings or using a plugin. If you’ve got some coding knowledge, you can also add a custom font within a child theme. 

This guide will walk you through each of these methods for adding custom fonts, while ensuring compatibility, performance, and accessibility.

Understanding font formats and compatibility

Before adding custom fonts, you must understand different font formats and their compatibility with various browsers.

Common font formats

  • TTF (TrueType Font): Compatible with most browsers but can be large in file size.
  • OTF (OpenType Font): Similar to TTF but supports advanced typographic features.
  • WOFF (Web Open Font Format): Optimized for the web, offering better compression.
  • WOFF2: More efficient than WOFF, providing better performance.
  • EOT (Embedded OpenType): Used by older versions of Internet Explorer.

Choosing the right format

For optimal compatibility, use WOFF and WOFF2. These formats are lightweight and widely supported by modern browsers.

Methods to add custom fonts to WordPress

There are multiple ways to add custom fonts to WordPress. Each method has its own advantages based on ease of implementation and customization needs.

1. Using the WordPress Font Library 

The Font Library is a feature that is included by default in WordPress versions 6.5 and later. It natively supports Google Fonts and allows you to upload your own fonts, but will only work with themes that support the block editor and full site editing under Appearance → Editor. If your theme uses the Customizer feature, skip to the number two method on this list.

Where to find the Font Library

  1. Head to Appearance → Editor in your WordPress dashboard.
navigating to Appearance --> Editor
  1. Click Styles in the left-hand menu.
opening the Styles panel
  1. Click the edit icon (pencil) next to the Styles heading.
Edit styles button
  1. Click on Typography in the Styles panel at the right.
Tyography option highlighted
  1. Scroll down to the Fonts section and click on the Manage Fonts icon (control slider).
button to manage fonts

How to add custom fonts to the Font Library

The Manage Fonts panel has three tabs:

  • Library: Shows all installed and theme fonts.
  • Upload: Add your own fonts (supports .ttf, .otf, .woff, and .woff2).
  • Install Fonts: Browse and install Google Fonts after granting access (which you can revoke anytime).
list of font library options and variants

Installing a Google Font

  1. First you’ll need to grant access to Google Fonts if you haven’t already.
option to connect to Google Fonts
  1. Search and pick a font.
searching for the Poppins font
  1. Select font variants.
selecting font variants in Google Fonts
  1. Click Install — done! The font will then appear as one of your font choices in the Library and Styles panels.

Uploading fonts

In the Upload tab in the Fonts Manager, simply drag your font file (.ttf, .otf, .woff, or .woff2) to the Upload font area and your font will automatically be installed. Like any Google Fonts you’ve installed, your uploaded fonts will also be available in the Library and Styles panels.

option to upload a custom font

Removing fonts

You can disable font variants or remove fonts entirely in the Library tab in the Font Manager.

  • Disable variants by unchecking them in the Library and clicking Update.
  • Delete a font by selecting it, checking the box, and clicking Delete (confirmation required).
checking boxes next to font variants

Changing default fonts

Fonts work globally (across your entire site) or on specific blocks. To change your fonts globally, go to Styles → Typography → Elements in the Editor, pick an element (text, headings, buttons, etc.), and customize the font, size, line height, and other aspects of your font’s appearance.

editing header styles

Pros: Easy to implement, no coding required.

Cons: Limited to block-enabled themes that allow full site editing.

2. Using the Customizer to enable custom Google Fonts (theme dependent)

If you are using a theme that uses the WordPress Customizer feature and has Google Fonts integrated already, you can add your custom fonts directly in the theme Customizer..

Steps:

  1. Go to Appearance → Customize
  2. Find the Typography or Fonts section (the exact location may be labeled slightly differently depending on your theme)
  3. Choose a Google Font from the dropdown
  4. Save and publish changes
selecting a base font

Pros: Easy to implement, no coding required.

Cons: Limited to Google Fonts and may only be available in certain themes…

Explore the benefits of Jetpack

Learn how Jetpack can help you protect, speed up, and grow your WordPress site. Get up to 50% off your first year.

Explore plans

3. Adding custom fonts using a plugin

Plugins simplify font integration by handling file uploads and CSS generation. If you’re not comfortable with coding, your theme doesn’t support the Editor, or your theme doesn’t offer the custom fonts you need via the Customizer, this will be the easiest route to get your custom fonts installed.

Recommended plugins:

Use Any Font plugin with a checklist of features

Install a custom font with the Use Any Font plugin:

  1. Install and activate the Use Any Font plugin.
finding the Use Any Font plugin
  1. Obtain the API key from the plugin settings.
settings for API keys for the Use Any Font plugin
  1. Upload your custom font (TTF, OTF, or WOFF).
Use Any Font upload font options
  1. Assign the font to specific elements (e.g., body, headings).
Assign font options for Use Any Font
  1. Save changes.

Pros: No need for manual coding.

Cons: Some features require a premium version.

4. Using a child theme for font integration

If you’re comfortable with adding some code to your site, you can add your custom fonts within a child theme. Using a child theme for theme customizations like incorporating new fonts or making changes to the theme stylesheet will prevent you losing those changes during theme updates. 

The following instructions include a brief overview of creating a child theme in WordPress. You will need access to your site’s directory via cPanel, Plesk, SFTP, or SSH. You’ll also need a plain text editor or code editing software like Notepad++, Sublime Text, or Visual Studio Code to create and make changes to child theme files.

If you need more in-depth instructions for creating a child theme, read How to Create a Child Theme in WordPress.

  1. Create a child theme
    • Navigate to wp-content/themes/ and create a new folder (e.g., yourtheme-child).
    • Inside this folder, create a style.css file and a functions.php file.
  2. Define the child theme
    • Add the following header inside style.css:
/*

Theme Name: Your Theme Child

Template: yourtheme

*/
  1. Enqueue the custom font
    • Open functions.php inside your child theme folder.
    • Add the following code:
function custom_fonts() {

    wp_enqueue_style('custom-fonts', get_stylesheet_directory_uri() . '/fonts.css');

}

add_action('wp_enqueue_scripts', 'custom_fonts');
  1. Upload font files and create a fonts.css file
    • Place the fonts in a /fonts/ directory within your main child theme directory.
    • Create a fonts.css file in the main child theme directory and add @font-face CSS rules.
@font-face {

  font-family: 'Custom Font Name';

  src: url('wp-content/themes/your-theme-child/fonts/customfontname.woff2') format('woff2'),

  font-weight: 300;

  font-style: normal;

}
  1. Activate the child theme
    • Go to Appearance → Themes and activate your child theme.

Pros: Changes remain intact after theme updates.

Cons: Requires theme development knowledge.

How to ensure font performance and accessibility

Optimize font loading

Large font files slow down websites. To optimize performance:

  • Use WOFF2 format for better compression.
  • Limit the number of custom fonts to reduce HTTP requests.
  • Use font-display: swap in CSS to improve rendering.

Ensure accessibility

  • Ensure text remains readable when fonts fail to load.
  • Provide fallback fonts like Arial, Helvetica, or sans-serif.
  • Test fonts on different devices and browsers.

Troubleshooting common issues

Font not displaying

  • Check if the file paths are correct.
  • Clear the site cache and CDN cache.
  • Inspect the browser console for errors (Ctrl + Shift + I > Console).

Slow loading fonts

  • Reduce font file size using font compression tools.
  • Implement lazy loading for non-critical fonts.
  • Host fonts on a CDN for faster delivery.

Enhancing typography with CSS

After you’ve added your custom fonts to your WordPress site, you can add global styles to headings, paragraphs, and other unique classes. Some of this can be done in the Editor or Customizer, but you can also do this with CSS. Make sure to make these style changes in your child theme’s style.css file.

Some examples include:

Adjusting font weight and style

h1, h2 {

    font-weight: 700;

}

p {

    font-style: italic;

}

Improving readability with line height

body {

    line-height: 1.6;

}

Customizing font sizes for different screen sizes

@media (max-width: 768px) {

    body {

        font-size: 16px;

    }

}

Final thoughts on adding custom fonts

Adding custom fonts to WordPress enhances branding and improves user experience. Whether using WordPress’ default tools, a plugin, or manually adding fonts using a child theme, choosing the right approach depends on your expertise and requirements as well as what your theme supports. 

Whatever method you choose, don’t forget to optimize fonts for performance to ensure better loading times and take accessibility considerations into account to improve usability for all visitors. Following best practices in those areas can help you achieve a visually appealing and professional website.

Managing typography and other aspects of website design is just one part of running a successful WordPress site. Your content matters, too. In fact, it’s probably the most important part — it’s what your readers and customers come to you for, after all.

But content creation, formatting, and optimization can be time-consuming. This is where automation tools like Jetpack AI Assistant can help streamline your workflow and enhance efficiency.

Simplify your WordPress workflows with Jetpack AI Assistant

Working with WordPress involves multiple tasks, from content creation to customization. Jetpack AI Assistant helps streamline these processes, allowing you to focus on design and user experience.

How Jetpack AI Assistant enhances workflow:

  • Automated content generation: Generate high-quality blog posts, product descriptions, landing pages, tables, and translations effortlessly.
  • Grammar and readability optimization: Ensure content clarity and consistency with AI-powered suggestions.
  • Seamless integration: Works directly within the WordPress editor for a smooth user experience.
  • Time-saving efficiency: Reduce content creation time, allowing you to prioritize design and branding.

By leveraging Jetpack AI Assistant, you can create engaging content while refining typography and font styles with ease. Explore how this AI-powered tool can optimize your workflow and enhance productivity.

This entry was posted in Developers, Website Design. Bookmark the permalink.
Developers Website Design

Jen Swisher profile

Jen Swisher

Jen is a Customer Experience Specialist for Jetpack. She has been working with WordPress and Jetpack for over a decade. Before starting at Automattic, Jen helped small businesses, local non-profits, and Fortune 50 companies create engaging web experiences for their customers. She is passionate about teaching others how to create on the web without fear.

Explore the benefits of Jetpack

Learn how Jetpack can help you protect, speed up, and grow your WordPress site. Get up to 50% off your first year.

Explore plans

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.