Custom typography can give a website a recognizable voice, but every font file adds work for a visitor’s browser. A page may briefly show no text, display a fallback font and then shift when the custom font arrives, or download styles that the page never uses. To optimize web fonts, keep the files you need, tell the browser how to handle them, and test the result on real pages.
You don’t need to remove every custom typeface. A few deliberate choices can improve loading while preserving the look and readability of your site. Here’s a step-by-step process that works for WordPress sites and other common website setups.
How to optimize web fonts: start with an inventory
Before changing files or settings, find out which fonts your site actually loads. A theme, page builder, plugin, and custom CSS can each add font requests. You might discover that a single page downloads several weights or styles even though its text uses only two.
Open a representative page in your browser and use its developer tools. In the Network panel, filter requests by “font” or look for files ending in extensions such as .woff2, .woff, .ttf, or .otf. Reload the page to see which files are requested. Check more than the homepage: a product page, article, or contact form may use different typography.
Make a simple list of each font family, weight, style, and source. Then ask:
- Is this font used on the page, or is it left over from an old theme or plugin?
- Does the site load multiple weights that look nearly identical?
- Are separate italic files necessary, or is italic used only in a few places?
- Does the site request font files from more than one provider?
Remove unused font declarations at their source when you can. If a theme setting loads a font sitewide, change the setting there rather than layering on CSS overrides. When a plugin or page builder controls the font, check its typography settings before editing theme files.
Choose smaller, suitable font files
For most modern websites, WOFF2 is a sensible format to serve because it is designed for web delivery and is widely supported by current browsers. You may keep a fallback format for older browser requirements, but don’t add extra formats without a reason. Every file listed as a possible source can add complexity, and a browser will select the first format it can use.
Use only the styles your design needs. A site that uses regular and bold text may not need separate files for five intermediate weights. Remove unused font weights and styles from your theme, builder, or font service. Don’t rely on a browser to make an exact bold or italic version from a regular file: synthetic styling may look different from the intended design, so verify the result.
Some typefaces offer variable font files that can provide a range of weights in one file. That can reduce the number of requests, but it isn’t automatically a smaller download in every case. Compare the file sizes and confirm that the variable font works with the browsers and styles you support.
For scripts or languages your site doesn’t use, a subset font can avoid downloading unnecessary characters. Be careful with this approach if visitors enter names, addresses, or comments in other languages. A narrowly subsetted font may display missing characters in user-submitted content. Keep the necessary character coverage for every page and input area.
Make text visible while fonts load
A font-loading strategy affects what visitors see before a custom font is ready. The CSS font-display property controls that behavior. For many sites, font-display: swap is a useful starting point: the browser displays text in a fallback font, then changes to the web font when it arrives. This avoids leaving text invisible while the browser waits.
Define a suitable fallback stack with fonts that are likely to be available on the visitor’s device. For example, a sans-serif design might use a system font followed by a generic sans-serif family. The fallback won’t be identical, but a similar category and proportion can make the change less noticeable.
When the custom font replaces the fallback, differences in letter width or line height can move nearby content. Choose a fallback with similar dimensions where possible, and check headings, buttons, navigation, and body copy. Some browsers support CSS font metric overrides such as size-adjust, ascent-override, and descent-override. These let developers tune a fallback’s metrics, but test the changes across the site rather than copying values without checking their effect.
Preload only fonts that matter immediately
Preloading asks the browser to fetch a resource early. It can help with a font used in prominent text near the top of the first page view, but preloading every font is counterproductive. It can compete with other important files, use bandwidth before it’s needed, and cause a duplicate request if the preload doesn’t match the font CSS.
Consider preloading only when testing shows that a particular font is needed early and is discovered too late by the browser. Use the exact file, format, and cross-origin settings required by your setup. A typical declaration looks like this:
<link rel=”preload” href=”/fonts/site-regular.woff2″ as=”font” type=”font/woff2″ crossorigin>
Ask your developer or hosting support to confirm the path and settings if you don’t manage the site’s HTML. After adding a preload, inspect the Network panel to confirm the browser fetches the file once and uses it. Remove the preload if it doesn’t improve what visitors experience.
Host and cache fonts thoughtfully
Fonts can come from your own website or a third-party font service. Self-hosting gives you control over the files and delivery, while a hosted service can simplify licensing, updates, and setup. Neither option is always better. Consider the provider’s terms, privacy implications, reliability, and how the font request affects page loading.
If you self-host fonts, use a secure connection and check that the files return successfully. Configure long-lived browser caching for font files when their filenames change when the files change, such as through versioned filenames or a content hash. That lets returning visitors reuse a previously downloaded font while ensuring a replacement file can be fetched after an update. Your host or caching tool may provide these settings.
Don’t copy a font file from a website unless its license allows you to use and host it. Check the font’s license and your provider’s terms before moving files. If your site uses a third-party service, avoid adding another font source for a nearly identical typeface without a clear design need.
Test typography after making changes
Compare the site before and after each change. Test on a phone-sized screen and a desktop-sized screen, and check pages with different templates. Use a private browser window or clear the cache so you can see how a first-time visitor experiences the page, not just a returning visitor with fonts already stored.
Look for practical problems, not just a lower file count:
- Does text appear promptly, including before the custom font loads?
- Do headings wrap in reasonable places on narrow screens?
- Are buttons and navigation labels still readable and properly sized?
- Do bold and italic text display as intended?
- Are there missing characters or visible jumps when the custom font appears?
- Does the browser still request fonts that you meant to remove?
If text wraps incorrectly or elements shift, check the font declaration and layout rules together. A typography change can affect widths and spacing, so a layout issue may not be fixed by changing the font alone. This CSS layout debugging checklist can help you trace problems that appear after a design adjustment.
A practical font optimization checklist
For an initial cleanup, keep the scope small. Inventory the fonts on key page types, remove files and weights you don’t use, choose a readable fallback, and set an intentional font-display behavior. Then test the first page view and check that the browser requests only the files you expect.
Make one change at a time, especially if a theme or builder controls typography across many pages. That makes it easier to spot a broken font path or unexpected layout change. Revisit the inventory when you change themes, add a page builder, or update your visual design. A lean, well-tested font setup can preserve your site’s character without making visitors wait for text to appear.
