WordPress Will Finally Get A Web Fonts API

WordPress Will Finally Get A Web Fonts API

After years of waiting, WordPress will finally get a web fonts API.

The popular WordPress Core Developer, Ari Stathopoulos, recently announced the implementation of a web fonts API in core WordPress. The announcement was made on the WordPress blog, you can find it here.

WordPress Will Finally Get A Web Fonts API

The idea behind this web fonts API is to standardize the way theme developers and producers register and enqueue font styles.

The history of web fonts API for WordPress

The idea of web fonts API for WordPress is not new.

John Alderson opened a ticket about the need of such a feature all the way back in 2018.

He was saying that:

“Loading custom fonts in a sub-optimal manner can cause significant performance and privacy issues.

Anecdotally, inefficient font loading is frequently one of the biggest performance bottlenecks in many WordPress themes/sites.

This is, in part, because there hasn’t been a ‘best practice’ approach; there’s no ‘standard’ way of adding a font to a theme and ensuring that it’s loaded in a performance- and privacy-friendly manner.”

The whole planet knows about the performance problems that WordPress themes have because of the way fonts are being added, not having a standard way.

Why is it important to have a web fonts API for WordPress?

If you created a WordPress theme, you know perfectly that it is nothing new to upload your fonts. All WordPress themes, or at least most of them, offer its users the option to change fonts, or even to install new fonts.

The problem is in the way that WordPress themes were created, from a fonts perspective. Not having a standardized way of uploading fonts, makes WordPress slower.

Slower websites mean a less great navigation experience, worse rankings on search engines, and possible the loss of website visitors and even sales.

The web fonts API will significantly improve performance of WordPress websites and make the development of themes much easier, having a standard way of uploading fonts.

And this is not all.

Having a quick and standardized way to upload fonts is a huge help.

It will start a competition between theme developers to add cool libraries of fonts, not just a few options.

We will have WordPress themes that will offer us a huge collection of fonts that we can use.

How will the web fonts API for WordPress work?

It is very simple.

Developers will be allowed to register fonts from local files or stylesheet URLs. This work exactly like those provided by Google Fonts and other 3rd party APIs.

In other words, the learning curve will be close to 0.

We will load fonts in the same way we load scripts and styles.

When will we use this new feature?

We estimate that WordPress API will be fully functional by the end of 2022.

Conclusions

Above all, WordPress is the favorite platform for website creation, powering over 42% of the total market of websites, or to say in exact number, more than 85,6 million websites.

Of course things are getting better and better, each year.

Finally, new WordPress themes are being developed and launched each day, important updates for the most popular themes also appear constantly, adding even more power, and core updates for WordPress are helping the platform to become better, more stable, and secure.

Now we are waiting the web fonts API for WordPress that will help the platform to become even faster.

Let’s all hope that it will become a dream come true no later than next year.