Standard fonts can often make a website look dated. If you are using Blogger (Blogspot), one of the most effective ways to modernize your site's design is by integrating Google Fonts. While Blogger provides a few default options, adding custom fonts requires a bit of manual coding to ensure they load correctly within Blogger's XML structure.
In this guide, we will walk you through the process of selecting, converting, and applying any Google Font to your Blogger template.
Step 1: Select Your Font on Google Fonts
The first step is to choose the typography that fits your brand. Visit the Google Fonts library and search for a font (e.g., Roboto, Montserrat, or Playfair Display). Click on the font style you want, then click 'Get font' and 'Get embed code'. In the selection drawer, look for the <link> tag code. It will look something like this:
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap" rel="stylesheet">
Step 2: Convert the Link for Blogger (XML Compatibility)
Blogger templates use XML, which is stricter than standard HTML. A standard Google Font link will often cause a 'template parsing error' because of the & character. To fix this, you must replace every instance of & in the URL with &.
Original: ...display=swap&family...
Corrected: ...display=swap&family...
Additionally, ensure the tag is self-closing by adding a forward slash (/) before the closing bracket: />.
Step 3: Insert the Code into Your Blogger Template
Now, you need to place this link in your blog's code. Follow these steps:
- Log in to your Blogger Dashboard.
- Go to Theme and click the arrow next to the 'Customize' button, then select Edit HTML.
- Click anywhere inside the code editor and press Ctrl + F (or Cmd + F) to search.
- Search for the </head> tag.
- Paste your corrected Google Font link directly above the </head> tag.
- Click the Save (disk icon) button in the top right corner.
Step 4: Apply the Font Using CSS
Adding the link tells the browser to load the font, but you still need to tell Blogger where to use it. You can do this by adding CSS to your template.
While still in the Edit HTML window, search for </b:skin>. Just above that line, add your custom CSS. For example, to apply the font to your entire blog, use:
body { font-family: 'Roboto', sans-serif !important; }
If you only want to change the post titles, use:.post-title { font-family: 'Roboto', sans-serif; }
Step 5: Verify the Changes
Once you have saved your template, click View Blog. Your new custom font should now be visible. If the font hasn't changed, try clearing your browser cache or check the Edit HTML section again to ensure the !important declaration was added to your CSS, which overrides any default template styles.
💡 Pro Tip: Keep your software updated to avoid these issues in the future.
Category: #Website