Skip to content

Add custom code to every page

Add your own HTML, CSS or scripts to the header or footer of every page of your site, or of a single post, page or tag.

Who can do this: Site-wide code: Owners and Administrators. Post and page code: anyone editing that post or page. Available on every plan.

Code injection lets you add a snippet to your site without changing your theme. Common uses are a verification tag from a search console, a small CSS tweak, a third-party chat or booking widget, or a font. What you add keeps working when you switch themes.

Add code to every page

  1. Go to Settings. Under Advanced, find Code injection and select Open.
  2. Choose Site header or Site footer (see the table below), and paste your code.
  3. Select Save. The code is on every page of your site straight away.
The Code injection row in Settings, described as “Add custom code to your publication”, with an Open link.
The Code injection editor on the Site header tab, containing an example verification meta tag and a style rule, with Close and Save buttons.
An example: a verification tag and a style tweak in the site header.
TabWhere the code goesUse it for
Site headerInside the page’s <head>, after your theme’s own tags<meta> verification tags, <style> blocks, fonts, scripts that must load first
Site footerAt the end of the page, just before </body>Widgets and most third-party scripts, so they don’t slow down your content
The Code injection editor on the Site footer tab, containing an example script tag that loads a chat widget from widget.example.com.
Third-party widgets usually belong in the footer.

Add code to one post or page

  1. Open the post or page in the editor.
  2. Open the settings panel with the button at the top right.
  3. Open Advanced, then Code injection.
  4. Add your code to Post header or Post footer (Page header and Page footer on a page). It’s saved with the post: select Update on a published post to make it live.
The Advanced section of a post’s settings panel, listing Post history, Code injection, Keyboard shortcuts and Delete post.

Post code is added after the site-wide code, so it can override it. Tags have code injection too: open a tag under Tags and expand Code injection to add code to that tag’s archive page.

Common mistakes

  • Pasting a whole page. Paste only the snippet you were given, not <html> or <body> tags.
  • An unclosed tag. A missing </style>, </script> or </div> can hide or break the rest of the page. If your site suddenly looks wrong after saving, remove the code you added last.
  • Expecting it in emails. Code injection only affects your website. Newsletters are sent without it.
  • Editing the theme instead. If a snippet needs to sit in a particular place inside a template, it belongs in the theme. See upload your own theme.

Good to know

  • Blogaly’s own analytics are built in and need no code. See your analytics.
  • Scripts you add run for every visitor and can collect data or set cookies. Blogaly’s analytics don’t use cookies, but a script you add might, and that may mean you need to ask visitors for consent. Check what each service does before you add it.
  • Only add code from sources you trust. A script can change anything on your pages.
  • Press Cmd+S (Mac) or Ctrl+S (Windows) to save while the code injection editor is open.

Last checked against the product on 7 November 2026.

Related

Still stuck?

Tell us what you were trying to do and what you saw, and we’ll help you sort it out.

Contact us