> ## Documentation Index
> Fetch the complete documentation index at: https://kb.hosting.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Importing custom Google Fonts in WordPress

> Google Fonts offers APIs for using web fonts on websites. Discover how to import custom Google Fonts in WordPress.

There are various techniques for changing the fonts on a [WordPress](https://hosting.com/hosting/platforms/wordpress-hosting/managed-wordpress-hosting/) site, such as installing a new theme. If you don't like the fonts that come with the theme, you can always replace them with custom Google fonts. Google Fonts, also known as Google Web Fonts, is a set of interactive application programming interfaces that allow users to incorporate web fonts into their websites. This article will show you how to add Google Fonts to [WordPress](https://hosting.com/hosting/platforms/wordpress-hosting/managed-wordpress-hosting/) using a short script.

## Configuring custom Google Fonts in WordPress

1. Log in to your WordPress site with an administrator account.

2. On the **Dashboard** in the left sidebar, click **Appearance**, and then click **Editor**:\
   ![](https://static.hosting.com/kb/kb_wep_themeeditor.png)

3. On the **Theme Editor**, select the **Theme** you want to edit from the dropdown:\
   ![](https://static.hosting.com/kb/kb_wp_edittheme.png)

4. The files for this selected theme are listed on the right column under **Theme Files**. Click on the file named "**functions.php"**:\
   ![](https://static.hosting.com/kb/kb_wp_edittheme_functions.png)

5. Add this code snippet / function at the bottom of your **functions.php** file:

```javascript theme={null}
function add_google_fonts() {

wp_register_style('OpenSans', '//fonts.googleapis.com/css?family=Open+Sans:400,600,700,800');

wp_enqueue_style('OpenSans');}

add_action( 'wp_print_styles', 'add_google_fonts' );

```

6. The above function uses 'wp\_enqueue\_style' tells WordPress to use this stylesheet (specified in the code above) inside the header of every page of your wordpress website.Open the CSS file and add the following code to use the Google Font:

```
body {

    font-family: 'Open Sans', sans-serif;

    font-size: 20px;

    color: #000000;

}

```

## Related articles

* [Changing Fonts in WordPress](/docs/change-the-font-in-wordpress)

* [Changing fonts using WordPress Classic Editor](/docs/changing-fonts-using-wordpress-classic-editor)

* [Embed Adobe fonts in WordPress sites](/docs/embed-adobe-fonts-in-wordpress-sites)
