🔤 How to Add a Custom Font in Divi
Want to give your website a unique look that stands out from the rest? Adding a custom font in Divi is a great way to personalize your site’s style beyond standard Google Fonts.
Here’s a simple step-by-step guide to uploading and using your own font.
🪄 Step 1: Prepare Your Font File
Make sure your custom font is in one of these supported formats:
.ttf
.woff
.woff2
.otf
We recommend using .ttf
or .woff
for best compatibility.
⚙️ Step 2: Allow Font Uploads via functions.php
🔒 Important Note:
This only allows font uploads for logged-in admin users and should be removed after uploading your font. It’s safer than modifying wp-config.php
, but don’t leave it active and remove the code after your font has been uploaded.
By default, WordPress restricts certain file types for security reasons — including most custom fonts. To temporarily lift this restriction and allow font uploads, follow these steps:
🔧 How to Edit functions.php
from the Dashboard:
- Log in to WordPress Admin Dashboard
- Go to Appearance → Theme File Editor
- On the right, find and click on
functions.php
(usually labeled as Theme Functions) - Scroll to the bottom of the file and paste the following code:
- Scroll to the bottom of the file and paste the following code:
function allow_unfiltered_uploads() {
define('ALLOW_UNFILTERED_UPLOADS', true);
}
add_action('init', 'allow_unfiltered_uploads');
- Click on Update File
- Wait until it says “File “File edited successfully.
🖼️ Step 3: Upload Your Custom Font in Divi Using Built-In Tool
Divi makes it easy to upload custom fonts without any coding — if WordPress allows the file type.
Here’s how to do it:
📌 Steps to Upload a Font in Divi:
Select “Upload”, then choose your .ttf
, .woff
, or .otf
font file
In your WordPress Dashboard, go to
Divi → Theme Options
Click on the Builder tab and then go to the Advanced sub-tab
(Or simply open any page and edit a text module in the Divi Builder)
Inside the Text Module, click:
Design → Text → Font → Upload (scroll to the top of the font list)
⚠️ Common Error: “Sorry, this file type is not permitted for security reasons”
If you see this message when uploading your font, it means WordPress is still blocking the file type.
To fix it, make sure you completed Step 2 above and added this to your functions.php
file: