Squarespace, Weebly and WordPress: Insert Header Code

August 7, 2018

While building your site on WordPress, you've probably come across the phrase "insert this code into your header".  This instruction is fairly vague, but luckily it's not complicated. Learning how to insert header code is fairly essential for a a small business website. If you want to track your website traffic using Google Analytics, verify your site with Pinterest or embed fonts from Google, knowing how to insert header code is essential.

Luckily, this is actually a pretty straightforward process, and you don't even need to learn a single bit of HTML (if you don't want to). Most CMS platforms have a simple way to insert header code that is safe to use and unlikely to bring down your site.

WordPress: Insert Header Code Using a Plugin

In WordPress, you can insert header code using the PHP files in your CPanel, or by accessing your theme's files via the Editor. This requires a reasonable knowledge of coding, so I wouldn't recommend this route for beginners. So let's take a look at how, in WordPress, we can insert header code without accessing any PHP or theme files. This can be achieved by installing a simple but incredibly useful plugin, helpfully called "Insert Headers and Footers". This is a great option because the plugin will remain in place when updating or changing your theme, so nothing will be erased by accident!

Once you've installed this plugin, hover over "Settings" in the left hand sidebar in your WordPress dashboard. You should now see "Insert Headers and Footers" in the pull out menu. Click on this option, insert your header code and click save. Voila!

Squarespace: Insert Header Code Using Code Injection

User-friendly Squarespace provides an easy way to insert header code via it's Advanced Settings. Keep in mind that Squarespace recommends you only use Code Injection if you have some coding knowledge. Any custom code falls outside the scope of Squarespace support. However, if you're simply copying and pasting code from Google Analytics or a domain verification script from Pinterest, you shouldn't encounter any issues. This warning would mostly apply to anyone trying to write and insert their own script.

  • Open Code Injection by travelling to the Home Menu, and clicking on Settings > Advanced > Code Injection
  • Add valid HTML or scripts into the appropriate Code Injection fields. When copying and pasting script, it will usually tell you the optimal place to put it, but it's usually the Header.
  • Now click Save and you're done!

Weebly: Insert Header Code Using the Site Editor

Inserting header code in Weebly is incredibly straightforward as well.

  • Login to Weebly and select the website you wish add the header code to
  • Click Edit
  • Under the top menu, click on Settings, then select SEO from the left sidebar
  • Insert the valid HTML or scripts into the appropriate field, whether that's header or footer.
  • Click Save, and you're done!

So there you have it! Whether you're working in WordPress, Squarespace or Weebly, inserting a header code needn't be complicated.

Let me know below if you have any alternative methods or if you'd like me to add instructions for your CMS platform!

Cheers, Laura   x

Interested in launching your website with WordPress? First make sure you know the difference between the dot com and dot org versions of WordPress!

Already decided to go ahead with WordPress? Follow my 5 Easy Steps to Go Live ASAP, or check out the 8 Things You Should Do Before Hitting Publish.

Ready for a website that reflects who you truly are?

Gain clarity in your digital presence, be confident in your messaging and save time in your business, with website design that engages users and reflects who you truly are.
My Website Design package will give you a beautiful, functional website that allows you to feel confident in your brand and build a real connection with your audience.

Find Out More

Learn how to insert header code with no coding experience
Squarespace, Weebly and WordPress: Insert header code

Liked that? Try these

What will my website designer need from me?

What does a website designer actually need from you in order to get started? From a logo to marketing data, it's all outlined here.

Read More
Why Good Design Matters to an E-comm Store

Good design matters when it comes to a conversion-focussed Shopify store. First impressions can make or break your user journey!

Read More
How to stand out online with stock photos

Images are a powerful design tool; learn how to plan for, pick and use stock images that tell the story of your business!

Read More
1 2 3 7
Laura F Gosney
Hey, I'm Laura
I’m a Soulful Brand and Website Designer specialising in creating beautiful, personality-driven brands that showcase how remarkable you truly are.

For more than 5 years, I’ve worked with innovative e-commerce founders, passionate service-based businesses, and inspiring creatives to capture the remarkable soul of their work and transform that into a brand and website they can feel proud of.
Find out how I can help
I acknowledge the First Nations people as the Traditional Owners of the land on which I live and work, i.e. Meanjin, Brisbane. Sovereignty was never ceded.
Copyright © 2023 Laura F Gosney ABN: 88 413 183 164

Words by Brit Stevens
linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram