Get the free theme
View Categories

How to Add a Script to the WordPress Header or Footer

< 1 min read

Adding a script to your header or footer, an analytics tag, a font loader, a verification meta tag, or a chat widget, usually means editing your theme’s files or installing a plugin for each one. Loupely Canvas gives you 2 code boxes for it, so you don’t touch theme files.

Head or body, and why it matters

  • Scripts that need to load early, or tags that belong in the document head (verification tags, fonts, most analytics), go in the head box.
  • Scripts you want to load late, after the page content, go in the body box. Canvas prints it just before the closing body tag.

Adding it

Go to Appearance, Loupely Canvas. Paste your snippet into the head box or the body box. It prints on every page, in the position you chose, with no theme files edited. Because Canvas renders your markup as written, the snippet you paste is the snippet that ships.

A note on permissions

Raw script is kept for accounts with the unfiltered_html capability, which administrators have on a standard single-site install. That’s the normal WordPress rule, and the settings screen says so.