
How to Manage Fonts with the WordPress Font Library?
- Sajjad
- Typography
- 01 Oct, 2026
A site owner wants to try a new headline font for a product launch. A few years ago, that meant filing a ticket, waiting for a developer to download files, edit theme code, and deploy. On a modern WordPress block theme, the site owner can open the Site Editor, install the font, activate two weights, apply it to headings, and preview the result in a couple of minutes. That workflow is the Font Library, added in WordPress 6.5, and it changes who manages typography on a WordPress site and where the files live.
This article explains what the Font Library is, how to install fonts from Google Fonts or upload your own, how activation actually works, where the files and data are stored, and how developers can restrict, extend, or disable the feature with a few lines of PHP.
What Is the WordPress Font Library?
The Font Library is a font manager built into the Site Editor. It lets users with the right permissions:
- Install fonts from font collections, such as the built-in Google Fonts collection
- Upload their own font files (WOFF2, WOFF, TTF, or OTF)
- Activate and deactivate individual font faces (weights and styles)
- Delete fonts they no longer need
Installed fonts are downloaded to your own server and served from your domain. Even fonts installed from the Google Fonts collection are copied locally, so visitors' browsers never contact Google's servers to render them. That is a meaningful privacy improvement over hotlinking, for the reasons covered in whether Google Fonts are GDPR-compliant.
The Font Library sits alongside fonts defined by the theme. Theme fonts come from theme.json and are part of the theme's code. Font Library fonts are site data, managed by users, and survive theme updates. If you are building the theme yourself, registering fonts in theme.json is still the right place for the typefaces your design depends on.
| Aspect | Theme fonts (theme.json) | Font Library fonts |
|---|---|---|
| Who adds them | Theme developer | Site administrator |
| Where files live | Theme folder, e.g. assets/fonts/ | wp-content/uploads/fonts/ by default |
| Stored as | Theme code | wp_font_family and wp_font_face posts |
| Survive theme switch | No, they belong to the theme | Yes, but must be reactivated |
| Can be deleted in UI | No | Yes |
Opening the Font Library
- Go to Appearance → Editor to open the Site Editor.
- Click Styles, then Typography.
- In the Fonts section, click the manage fonts button (or Add fonts if none are installed yet).
A modal opens with three tabs:
- Library: every font available on the site, grouped into theme fonts and custom fonts, with toggles for each face
- Upload: drag-and-drop for your own font files
- Install Fonts: browsable font collections, including Google Fonts
The Font Library is part of the Site Editor, so it is built for block themes. If your site uses a classic theme, you will generally add fonts through the theme or a plugin instead, as described in how to add a custom font to a WordPress website.
Installing Fonts from Google Fonts
The first time you open the Install Fonts tab, WordPress asks for permission to connect to Google Fonts. This connection only happens in the admin, to fetch the catalog and download files. Once you agree:
- Search or filter by category (sans-serif, serif, display, handwriting, monospace).
- Click a family to see its available faces.
- Tick only the weights and styles you will actually use, for example Regular 400, Italic 400, and Bold 700.
- Click Install.
WordPress downloads the selected files to your server and activates them. Be selective. Installing all eighteen faces of a family does not slow your pages by itself, because browsers only download faces that the page uses, but it clutters the weight dropdown and invites inconsistent use. Two families with three or four faces each is plenty for most sites.
Check whether the family offers a variable version. A single variable file covering weights 100 to 900 is often smaller than three static weights combined.
Uploading Your Own Font Files
For licensed commercial fonts or brand typefaces, use the Upload tab. WordPress reads the font's internal metadata to determine the family name, weight, and style, so the files must be well-formed.
Before uploading:
- Confirm your license allows self-hosting on the web. A desktop license usually does not cover web use. Check the terms before uploading anything.
- Prefer WOFF2. It is the smallest format and supported by every current browser. Convert TTF or OTF files if your foundry did not supply WOFF2:
pip install fonttools brotli
fonttools ttLib.woff2 compress BrandSans-Regular.ttf
- Subset if the font is large. A font with thousands of glyphs for scripts you do not use wastes bandwidth. A Latin subset keeps the essentials:
pyftsubset BrandSans-Regular.ttf \
--unicodes="U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD" \
--layout-features='*' \
--flavor=woff2 \
--output-file=BrandSans-Regular.woff2
- Upload all faces of a family together so WordPress groups them under one family.
Activating, Applying, and Deleting Fonts
Installing a font does not automatically mean it appears on your site. In the Library tab, each family has toggles for its faces. Only active faces are added to the site's available font families and appear in block font pickers. Click Update after changing toggles.
Activation is stored in the site's global styles, the same wp_global_styles record that holds any typography changes made in the Site Editor. That has one practical consequence: global styles are per theme. If you switch themes, the fonts remain installed in the library, but you need to activate them again for the new theme.
Once active, apply a font in one of three places:
- Styles → Typography → Text / Headings / Links / Buttons / Captions to set site-wide defaults
- Styles → Blocks → (block) → Typography to set a default for one block type
- The block sidebar for a one-off change on a single block
Site-wide defaults are almost always the better choice. Per-block font changes are stored in post content, so they will not update when you change the global setting later.
To remove a font, select it in the Library tab and click Delete. WordPress removes the font posts and the files from the server. Theme fonts cannot be deleted here; they disappear only if you remove them from theme.json.
Where WordPress Stores Fonts
Under the hood, the Font Library uses two custom post types:
wp_font_family: one post per family, with the family's settings (name, slug, CSS stack) stored as JSON in the post contentwp_font_face: one post per face, a child of its family post, with the@font-facedata and a reference to the file
The font files themselves go to wp-content/uploads/fonts/ by default. You can inspect what is installed with WP-CLI:
wp post list --post_type=wp_font_family --fields=ID,post_title,post_name
wp post list --post_type=wp_font_face --fields=ID,post_title,post_parent
Or through the REST API, which the Site Editor itself uses:
curl -s -u admin:APP_PASSWORD \
https://example.com/wp-json/wp/v2/font-families?per_page=100
Because fonts live in the uploads directory and the database, your normal backup and migration routine must include both. A database-only migration leaves font posts pointing at missing files, and fonts silently fall back. Your WordPress backup process should already cover uploads, but verify it.
Changing the Font Directory
If you want fonts outside the uploads directory, for example to keep them out of a media offload plugin or a CDN sync, use the font_dir filter:
<?php
// wp-content/mu-plugins/font-directory.php
add_filter( 'font_dir', function ( array $font_dir ): array {
$font_dir['basedir'] = WP_CONTENT_DIR . '/fonts';
$font_dir['baseurl'] = content_url( 'fonts' );
$font_dir['path'] = $font_dir['basedir'];
$font_dir['url'] = $font_dir['baseurl'];
$font_dir['subdir'] = '';
return $font_dir;
} );
Set this before any fonts are installed. Fonts installed earlier keep their old URLs.
Controlling the Font Library as a Developer
Removing the Google Fonts Collection
Some organizations want users to choose only from approved fonts. Unregister the built-in collection:
<?php
add_action( 'init', function () {
wp_unregister_font_collection( 'google-fonts' );
} );
Users can still upload files, but the Install Fonts tab no longer lists the Google catalog.
Registering a Custom Collection
You can offer a curated set of brand fonts as a collection. Files are hosted wherever you choose, and users install them with one click:
<?php
add_action( 'init', function () {
wp_register_font_collection( 'brand-fonts', array(
'name' => __( 'Brand Fonts', 'my-plugin' ),
'description' => __( 'Approved typefaces for Acme properties.', 'my-plugin' ),
'font_families' => array(
array(
'font_family_settings' => array(
'name' => 'Acme Sans',
'slug' => 'acme-sans',
'fontFamily' => '"Acme Sans", system-ui, sans-serif',
'fontFace' => array(
array(
'fontFamily' => 'Acme Sans',
'fontStyle' => 'normal',
'fontWeight' => '100 900',
'src' => 'https://cdn.example.com/fonts/AcmeSans-Variable.woff2',
),
),
),
'categories' => array( 'sans-serif' ),
),
),
'categories' => array(
array( 'name' => __( 'Sans Serif', 'my-plugin' ), 'slug' => 'sans-serif' ),
),
) );
} );
For larger collections, font_families can also point to a JSON file URL or path that follows the font collection schema, which keeps the PHP short.
Disabling the Font Library
On tightly controlled sites, such as large multi-author publications or client sites where brand typography is fixed, you can turn off the UI entirely:
<?php
add_filter( 'block_editor_settings_all', function ( array $settings ): array {
$settings['fontLibraryEnabled'] = false;
return $settings;
} );
Theme fonts continue to work and remain selectable in blocks. Only the ability to install, upload, and delete fonts is removed. You can also restrict typography choices further with the settings.typography controls in theme.json.
Moving Library Fonts into a Theme
If a font chosen in the Font Library becomes part of the permanent design, it is better to ship it with the theme. The Create Block Theme plugin can save Site Editor changes, including installed fonts, back to the theme: it copies the font files into the theme's assets/fonts folder and writes matching fontFace entries into theme.json. After that, you can deactivate or delete the library copy so the font is not defined twice.
WordPress Font Library FAQ
The Font Library shipped in WordPress 6.5 in April 2024. It is available in the Site Editor under Styles, Typography, and works with block themes.
No. When you install a font from the Google Fonts collection, WordPress downloads the files to your own server. Visitors load the fonts from your domain, and the only connection to Google happens in the admin while browsing and installing.
Font files are stored in the wp-content/uploads/fonts directory by default, and the font data is stored as wp_font_family and wp_font_face posts in the database. Developers can change the directory with the font_dir filter.
The fonts are still installed, but activation is saved in global styles, which are stored per theme. Open the Font Library in the new theme, toggle the faces you need back on, and apply them again in Styles.
Yes, as long as your license permits self-hosting the font on a website. Desktop licenses typically do not cover web use, so check the foundry's terms or buy a web license before uploading.
Set fontLibraryEnabled to false through the block_editor_settings_all filter, or unregister the Google Fonts collection if you only want to prevent catalog installs. Theme fonts remain available either way.
Conclusion
The WordPress Font Library gives site owners a safe, self-hosted way to manage typography without touching theme code. Fonts from Google Fonts or uploaded files land on your own server, activation is a set of toggles, and active fonts flow into the same global styles system that controls headings, body text, and individual blocks.
For developers, the important details are where things live and how to control them. Files sit in wp-content/uploads/fonts and data in two custom post types, so backups and migrations must include both. Activation is per theme. And with wp_unregister_font_collection, wp_register_font_collection, the font_dir filter, and the fontLibraryEnabled setting, you can shape the feature to fit anything from a personal blog to a locked-down brand site.
Here are some useful references for going deeper on the WordPress Font Library:
- Make WordPress Core: New Feature: Font Library — the core dev note introducing the feature, collections, and filters.
- WordPress Developer Resources: wp_register_font_collection() — function reference for custom collections.
- WordPress Developer Resources: wp_unregister_font_collection() — function reference for removing a collection such as Google Fonts.
- WordPress.org Plugins: Create Block Theme — saves Site Editor fonts and styles back into a theme.


