# Header & Footer Code for WordPress

> Add analytics tags, pixels, meta tags or custom CSS to every page without editing the theme. Part of Toggleworks, one plugin for the whole site.

TW-COR-12 Core


Add analytics tags, pixels, meta tags or custom CSS to every page without editing the theme.

[Get it from $26 a year](https://togglework.app/pricing/#plans) [Try it in the demo](https://togglework.app/demo/)

Header & Footer Code

**Part number**
: TW-COR-12
**Section**
: [Core](https://togglework.app/features/core/)
**Settings**
: 5 (1 on/off)
**Starts**
: Switched off
**In plans**
: Every plan

## Why it matters

Analytics tags, advertising pixels, verification meta tags and small CSS fixes all need to go into every page. Pasting them into the theme means they vanish on the next theme update or switch.

### What it does

- Code inside the page head, right after the body opens, and before it closes.
- Custom CSS for the whole site.
- Optionally skips logged-in administrators, so your own visits stay out of analytics.

![Header & Footer Code settings screen in the Toggleworks WordPress plugin, showing Inside, After opens, Before, Custom CSS](https://togglework.app/wp-content/themes/toggleworks-site/assets/img/parts/core-header-footer-code.webp?v=1795524164)

The Header & Footer Code screen in wp-admin, where you switch it on and change its settings.

## Set it up

1. Paste each tag where its provider says: most go in the head; some (such as Google Tag Manager’s noscript) go after the body opens.
2. Check the page source to confirm the code is there.

## What you can set

Switch Header & Footer Code on in Toggleworks → Core, then adjust any of these. Each one starts with a default, so you can switch the part on first and fine-tune later.

- Inside
- After opens
- Before
- Custom CSS
- Skip for logged-in administrators

## Good to know

- For PHP or conditional code, use [Code Snippets](https://togglework.app/features/core/code-snippets/) instead.
- Tracking tags may need cookie consent first; see [Cookie Consent](https://togglework.app/features/core/cookie-consent/).

## One less plugin to install

Header & Footer Code does a job people often install a separate plugin for:

- Code snippets and header/footer codeOften done with ASE
- Adding code to the header and footerOften done with WPCode

## Comes with 187 more parts

Header & Footer Code is one part of Toggleworks, a single plugin for security, speed, SEO, backups, email and store tools. Switch on what your site needs; the rest stays off and loads nothing.

[All 27 Core parts](https://togglework.app/features/core/)

### People also look for it as

- scripts
- analytics
- pixel
- css
- head
- body
- snippet

## Often switched on with it

- [Code Snippets](https://togglework.app/features/core/code-snippets/) — TW-COR-03 · Add PHP, CSS, JavaScript and HTML snippets without editing theme files — with conditions, revision history and automatic shut-off… · Own screen in wp-admin
- [Asset Manager](https://togglework.app/features/performance/asset-manager/) — TW-PRF-01 · See every CSS and JavaScript file a page loads and switch off the ones it does not need — on one page, everywhere, or everywhere… · Own screen in wp-admin
- [Cookie Consent](https://togglework.app/features/core/cookie-consent/) — TW-COR-06 · A small, fast consent banner (no external service). Tracking scripts marked for consent only run after the visitor accepts. · 7 settings
- [Search Log](https://togglework.app/features/core/search-log/) — TW-COR-21 · See what visitors type into your site search and which searches find nothing: a direct list of content to write and products to… · 2 settings
- [Admin Branding](https://togglework.app/features/white-label/admin-branding/) — TW-WHL-01 · Rebrand wp-admin: footer text, admin bar logo, a custom dashboard welcome box and a fixed color scheme. · 10 settings
- [Defer & Delay JavaScript](https://togglework.app/features/performance/defer-scripts/) — TW-PRF-05 · Stop scripts from blocking page rendering by deferring them, or delaying them until the visitor interacts. Test your key pages… · 6 settings

## Questions

**Is Header & Footer Code included in every Toggleworks plan?**

Yes. Every plan includes all 188 parts, Header & Footer Code among them. Plans differ only in how many sites you can use them on, and staging or local copies of a site don’t count.

**Does Header & Footer Code slow my site down when it’s switched off?**

No. Every part starts switched off, and a part that is off loads none of its code. Switch on Header & Footer Code only if your site needs it.

**What if a setting locks me out?**

Add `define( 'TOGGLEWORKS_SAFE_MODE', true );` to wp-config.php. It pauses every part until you remove the line, and Tools → Recent changes lets you undo a change.

**Can I try Header & Footer Code before I buy?**

Yes. The [live demo](https://togglework.app/demo/) runs a WordPress site with Toggleworks in your browser, and every plan has a 14-day refund.

## Switch off the plugin pile.

All 188 parts, one license, updates and support. 14-day refund.

[Choose a plan](https://togglework.app/pricing/#plans) [Try the live demo](https://togglework.app/demo/)

---

Source: https://togglework.app/features/core/header-footer-code/
