Add custom fonts to your Shopify theme [Complete Guide]

Most Shopify themes, by default, come with a variety of Google Fonts built-in. Depending on your theme, you can easily find and change them on the Customize page of your theme and play around with a few different styles and combinations.

However, one thing that is not quite straightforward in Shopify is: how exactly can you add your own custom fonts? Say you have downloaded a new font and you have now a few .ttf, .woff, .woff2, and/or some other file extensions. How would you go about adding them to your theme and, equally important, making them the default instead of whichever font was previously being used?

In this tutorial, I'll be teaching you how to achieve that. Also, don't worry – no coding knowledge is required, but for more thorough customizations of how to style each specific HTML element with your font of choice, you may need some familiarity with HTML/CSS.

Making a backup copy of your theme

Before diving into the tutorial make sure you download the theme, so in case you face any issues you can easily revert back.

Step 1: Adding the font files to your store

The first thing that we have to do is to add the fonts to the Shopify store. From there, we can reference it via code and use it in our theme.

  1. From your Shopify admin, navigate to Content > Files > Upload Files


  2. Click on upload files at the top right and upload all of your font files. Web Font files are the ones that have the following extensions: .ttf, .woff,.woff2, .eot, .svg or .otf.

    Therefore, make sure you upload all font files that came with the .zip, or at least the ones you want to use.

    In this case, I have one single font file with the .otf format, so I'll be uploading only this one.


  3. Once you have uploaded all of your font files, it's time to add some code to read them.

    Leave this tab open, though – we'll be returning to it soon.

Step 2: Adding the code to read the font

  1. In your Shopify admin, navigate to Online Store > Themes Actions Edit Code.


  2. Under sections, click on “Add a new section” and create a section named:

    ezfy-custom-fonts

    Creating the ezfy-custom-fonts section in the Shopify code editor
  3. Paste the following code and save:




  4. Now, open the file named theme.liquid. Make sure it reads exactly “theme.liquid”.


  5. Search for:

    <body
  6. Paste the following code right below the line you found:

    {% section 'ezfy-custom-fonts' %}

Step 3: Using the custom font on your website

  1. On the top left, click on the 3 dots and “customize theme”.


  2. On the sidebar located on the left side, you will find a new section called “EZFY Custom Font”.

    Click on the arrow on the left to expand it, and then click on “Add font”.


  3. Under “Custom font name”, make sure you add a descriptive name. It can be anything you wish.

    My font's name is “Cloud”, so I'll be adding that.

    Now, under “Custom font URL”, add the URL for the file that was added back in step 2. Simply click on the chain icon to get the font's URL.




On the screenshot above you can see that the font is immediately loaded right on the Customize page.

You can select which HTML elements should display your custom font, as well as add as many fonts you'd like.

Bear in mind that whatever font is first in the list will always overwrite the ones below it. Therefore, if you have added 5 fonts and assigned the “H1” for all 5 of them, the “H1” will use only the very first font in the list.

Extra: adding the custom font only to specific elements

If you'd like to use your custom font only for specific elements, you can use the “CSS Selectors” and add your selector there. Continue reading below to learn how to find your website's CSS selector.

  1. While in the page containing the element whose font you wish to change, press CRTL + shift + c to open your browser's developer tools in inspection mode. If you're using a Mac, that's CMD + shift + c instead.
  2. Find the text you want to change the font of and click it. This will highlight the element in the HTML.

    Selecting an element in the Impulse theme product page
  3. Next, right click the element in the HTLM, go to “Copy” and click “Copy selector”. This will copy a CSS selector meant to target this exact element.

    Copying an element's selector from Chrome's developer's tool
  4. Now that you have your CSS selector, simply copy and paste it at the very bottom at “CSS Selectors”:


  5. Note that this is a hard coded solution meant to select a single element, meaning that changes to your store's HTML (specially to areas near where the font was changed) are likely to cause it to stop working.

    If that happens, you can re-do this section of the tutorial or use a broader CSS selector. You can do it as many times as you want for any number of elements.

Conclusion

Custom fonts are great, but use them wisely: too many fonts will end up overloading your website and taking a toll on its performance.

Remember that you can also fully disable the EZFY custom font at any time you wish by simply clicking on “EZFY Custom Font” > uncheck “Enable”.


You may also be interested in some other tutorials:

– How to make slideshow images stop cutting off
– How to add a collection with tabs section to any theme (copy/paste, no apps, blazing fast)

Shop

You may also like

Here are some other blog posts you may be interested in.

Customers'Recommendations

Testimonials

Our clients' satisfaction is our main priority.

Danail Ilev's on Facebook.

DanailIlev

Sofia, Bulgaria

10/10!!! Customization and bug repairs that were impossible for a few previous devs of mine were an easy task for Diego! Honestly cannot recommend him enough. If you like testing different tweaks on your site or have an annoying bug - he's the man. Also his response time is of the charts + same day delivery (Amazon of devs 😁)
Review source
Brogan Domaschenz's on Facebook.

BroganDomaschenz

Australia

VERY VERY IMPRESSED! - understood exactly what i was trying to get across and produced something even better then i could of imagined in a shorter time frame then expected and in a very professional manner. Even though its the festive season, and i needed the coding done urgently, you were quick to respond and get in and get the job done, sacrificing your own holiday time, you absolutely went above and beyond all expectations. I cant recommend you enough!!! 🔥🔥🔥 Top Bloke!
Review source
Mackenzie Dodge's on Facebook.

MackenzieDodge

Colorado, USA

Diego was so easy to work with, I literally had the code to fix the announcement banner on our shopify store in less than 15 minutes! From the time I messaged him on FB to the time I had the code with instructions in my email I barely had time to get coffee! Plus payment was affordable and easy! I wish I had the week back I tried to fix it myself. Will definitely message them FIRST in the future!
Review source
Ibraheem Nadeem's on Facebook.

IbraheemNadeem

Michigan, USA

Diego is amazing at what he does. I've been using his web development services for over a year (I have 20+ projects completed with the EZFY team) and he is always super helpful. His CRO tips are incredible and have definitely helped my conversion rates! Super fast turn around time and always willing to help with support after the project is done. HIGHLY Recommend Diego and the EZFY team for all your Shopify web development needs!
Review source
Anna Dineva's on Facebook.

AnnaDineva

Paris, France

Diego is great ! Very responsive and customizes everything to your wish. Very friendly and comprehensive, + the delivery is immediate. I enjoy a lot working with him ! Recommend 100% !
Review source
Matt Reseigh's on Facebook.

MattReseigh

Adelaide, Australia

Diego was extremely accommodating and easy to work with. He has an extensive amount of knowledge and is willing to go above and beyond. I will certainly be using his services again in the future. Highly recommend!
Review source
Ronny Berco's on Facebook.

RonnyBerco

Toronto, Ontario

Incredible work - I got them to help fix some things on my Shopify store and for such a great price! They were extremely fast and went above and beyond in filling my request. On top of that they made even more great suggestions on fixes I can do for the site. Thanks! Will definitely work with you again.
Review source
Mev Omie's on Facebook.

MevOmie

Melbourne, Australia

One of the best website developers out there! Always on time and exceeds expectations!
Review source
Daniel Walker's on Facebook.

DanielWalker

Melton, Australia

Super happy with Diego’s work! He was quick to help out, easy to communicate with, and finished the work I needed at a very high standard! Thank you Diego!
Review source
Wei Tan's on Facebook.

WeiTan

Australia

Diego is a great resource. He's prompt and highly accommodating, which all leads to a great end result. Highly recommended!
Review source
Shawn Pansiri's on Facebook.

ShawnPansiri

Working with Diego was one of the best experiences I have ever had he is a professional and knows his stuff, anything you ask he will get it done he will also go out of his way and help you out if your knowledge is limited in some areas. One of the best hires I have come across and will hire in a heartbeat. Keep up the good work Diego!
Review source
Jeffrey Richardson's on Facebook.

JeffreyRichardson

Toronto, Ontario

This team went FAR beyond my expectations! It felt as if i had another employee, instead of a service. Their recommendations and exceptional work made my project come out perfectly. Their ability to show me examples, modify at no cost and finish everything extremely fast was amazing. will work with these guys for now on.
Review source
Conny Segervall's on Facebook.

ConnySegervall

Nykarleby, Finland

Hands down the best agency I have ever worked with. Always happy with the awesome results :)
Review source
Richard Agyemang's on Facebook.

RichardAgyemang

Philadelphia, USA

He is the best at what he does. I have worked with a couple of developers but he is by far the best. Thanks for such an amazing job on my site. I 100% recommend him
Review source

Contact Us

Let us know what type of customizations you're looking for.

Send us an e-mail and we'll get back to you within 24 hours! Before you click on "send message" please make sure to do the ReCaptcha so your e-mail can be sent safely.

Loading...