Squarespace, Weebly and WordPress: Insert Header Code

August 7, 2018
by Laura

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 Questions Should I Ask My Website Designer?

Hiring a website designer should be based on more than just aesthetics or who you like the best. Any investment needs to be strategic!

Read More
How you Benefit from a Collaborative Design Process

A highly collaborative design process that supports you from start to finish, gives you the tools you need to keep your website looking fresh

Read More
The Real Reason your WordPress site is a little slow

The world of optimising websites is a deep and oft-times confusing one. Web developers / designers have so much jargon style language that even for me (one of them!), it can feel like we're not even speaking the same language.

Read More
1 2 3 6

Leave a Reply

Your email address will not be published. Required fields are marked *

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 © 2022 Laura F Gosney ABN: 88 413 183 164
linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram