Plugin
Header, Footer & Body Scripts
Add named scripts to your header, body or footer — Analytics, Pixel, verification tags — each tagged with a consent category. Zero bloat.
/**
Plugin header
- Plugin name:
- Header, Footer & Body Scripts – EPAS
- Version:
- 1.0.0
- Requires at least:
- 6.4
- Requires PHP:
- 7.4
- Languages:
- English, Lietuvių
- License:
- GPL-2.0-or-later
- Download size:
- 32 KB
*/
What it does
- A list of named scripts, not three anonymous boxes. Each one has its place — inside
<head>, right after<body>, or before</body>— an Active switch, and its own options. - Snippets are printed exactly as you pasted them — analytics, tag managers, verification meta tags, chat widgets.
- Every script carries a consent category: necessary, preferences, analytics or marketing. With Cookie Consent & Privacy Policy – EPAS installed, the analytics one waits for permission while the necessary one prints — same page, same place, no guessing.
- Per-script "homepage only", a list of pages to exclude, and opt-in printing on the login screen.
- Only users with
unfiltered_htmlcan save code; everyone else sees a read-only screen and a clear explanation. - If another scripts plugin is active you get one dismissible notice — because two copies of Analytics count every visitor twice.
Questions
Who is allowed to add scripts?
Only accounts with the unfiltered_html capability (administrators on a single site, super admins on multisite). The check happens on the server, not just in the interface.
How do I stop a tracking script running before consent?
Give it the matching consent category and install the EPAS consent plugin. The script is printed inert — type="text/plain" — and the browser starts it the moment the visitor agrees, with no page reload and no cache exclusions.
Does it slow the site down?
The plugin adds one option read and prints your snippet. Whatever the snippet itself loads is up to the service you pasted.
Body scripts do not appear — why?
The body position needs a theme that calls wp_body_open(). Every modern theme does; very old ones may not.
How to get it
This plugin is finished and being prepared for the WordPress.org plugin directory. Until it is published there, email us and we will send you the current zip.