Header Footer Script Adder – Insert Code in Header, Body & Footer
Header Footer Script Adder – Insert Code in Header, Body & Footer
Description
Header Footer Script Adder is a powerful and user-friendly WordPress plugin that lets you easily insert custom HTML, CSS, and JavaScript into your site’s header, body, or footer.
You don’t need to edit theme files or worry about losing your code after updates. This plugin keeps your scripts safe, reusable, and flexible with conditional loading and per-page overrides.
✨ Features
- Add scripts to Header (
<head>), Body (after<body>), or Footer (before</body>) - Conditional Loading – load scripts sitewide, homepage only, posts/pages, or archives
- Per-Page Overrides – add unique code for specific posts and pages
- Code Editor with Syntax Highlighting (CodeMirror)
- Safe Input Handling – sanitization without breaking valid HTML, CSS, or JS
- Lightweight and Fast – minimal database queries
- Block Editor & Classic Editor Compatible
- Multisite Ready & Translation Ready
✅ Perfect For
- Google Analytics / GA4 tracking code
- Google Tag Manager
- Facebook Pixel and ad tracking
- Chat widgets (WhatsApp, Crisp, Tawk.to, etc.)
- Custom CSS and JavaScript
- SEO and verification meta tags (Google, Bing, Pinterest)
- A/B testing scripts
- External fonts and resources
⚙️ Conditional Loading Options
- Sitewide (all pages)
- Homepage only
- Posts & Pages only
- Archive pages
🔒 Security & Performance
- Sanitized input to prevent malicious injections
- Nonce verification for safe form submissions
- Admin-only access for configuration
- Clean uninstall process (no leftover data)
- Minimal performance impact
👨💻 Developer Friendly
- Extensible, documented code
- WordPress coding standards compliant
- Translation-ready
.potfile included - Works with any theme
Donations
If you enjoy this plugin and want to support development, you can buy me a coffee:
👉 https://www.buymeacoffee.com/mahethekiller
Support & Documentation
For support, feature requests, or documentation, please visit the support forum on WordPress.org.
Privacy Policy
This plugin does not collect or share personal data. It only loads the scripts you provide.
Any data collection depends on the external scripts you choose to add (e.g., Google Analytics, Facebook Pixel, chat widgets).
Installation
- Upload the plugin folder to
/wp-content/plugins/or install via the WordPress dashboard. - Activate the plugin from Plugins Installed Plugins.
- Go to Header Footer Script Adder in your admin menu.
- Paste your scripts and configure loading conditions.
- Save settings and done!
Manual Installation
- Download the plugin
.zip. - In WordPress Admin Plugins Add New Upload Plugin, select the zip file.
- Install and activate.
- Configure from Settings Header Footer Script Adder.
Screenshots
Faq
Yes. Input is sanitized, and only admins can add or edit scripts. It follows WordPress security best practices.
No. It’s lightweight and optimized. Scripts only load where needed.
Yes. Use the per-page overrides in the post/page editor.
Yes. Works with both Gutenberg and Classic Editor.
Yes. Each site can have its own configuration.
Yes. You can add multiple scripts in header, body, and footer.
Yes. Code is stored in the database, not in theme files.
When uninstalling, you’ll have the option to remove all saved scripts from your database.
Yes. The plugin supports any valid HTML, CSS, or JavaScript code.
Reviews
Per page additions & great support
By someguycalledralph on October 24, 2025
I love this plugin. It allows you to add to <head> on per page basis, which not a lot of these script inserter type plugins do. I use this to preload LCP images on a per page basis, which helps improve your website's core web vitals (better visitor experience, and improved rankings!).
I had one issue, I messaged support, and got a reply AND A FIX in a very short space of time. I was impressed!
If you need to do per page <head>, <body> or footer scripts on a per page basis, this plugin is a winner!
Simple and Reliable
By roimantra on June 19, 2025
I was looking for an easy way to add some custom JavaScript and tracking pixels to my WordPress site without digging into theme files—and this plugin did the job perfectly.
The Header and Footer Script Adder is incredibly straightforward. Just copy your code, paste it into the header or footer box, and you're good to go. It even lets you add scripts to individual pages or posts, which is super useful for things like conversion tracking.
What I really like:
- Super lightweight – doesn’t slow down my site at all.
- No complicated setup – very beginner friendly.
- Works across themes – I switched themes recently, and all my scripts still worked without any issues.
Honestly, it’s one of those plugins that does one thing and does it really well. No clutter, no unnecessary settings—just clean and effective.
If you need to insert scripts without breaking your site or getting lost in code, give this plugin a try. It’s now one of my go-to tools for every WordPress project!
Plugin Review: Header and Footer Script Adder
By abhishekkk on June 19, 2025
I've been using the Header and Footer Script Adder plugin for a few weeks now, and it's been a lifesaver. I needed a simple way to add custom scripts like Google Analytics, chat widgets, and a few tracking codes to my site—without touching theme files or editing functions.php.
This plugin does exactly what it promises. You can easily insert code into the header or footer of your entire site or even just on specific posts or pages. The interface is super simple and straightforward. No bloated settings or confusing options. Just paste your code and save—done!
What I love most is that it works regardless of the theme I’m using, so I don’t have to worry about losing my scripts if I change themes in the future.
Would recommend this plugin to:
- Beginners who need a quick solution for adding scripts.
- Developers who want a clean, no-fuss way to insert site-wide or page-level code.
- Anyone who wants to keep things organized and avoid messing with core files.
There are no unnecessary features, and that's honestly a good thing. It keeps everything lightweight and easy to manage.
Great job to the developer! This one’s staying on my must-have list.
Plugin Works As described
By m254032 on June 19, 2025
This plugin is very simple and easy to use, i have used it in many projects i does what it says. also new update is great.
Invasive & spammy donation requests on every page
By kermit666 on March 13, 2017
Changelog
1.0.0
- Initial release.
1.2.0
- Added new features and bug fixes.
- Improved UI for easier code management.
2.0.3
- Major release.
- Added global header, body, and footer script support.
- Conditional loading (sitewide, homepage, posts, archives).
- Per-page script overrides.
- Integrated CodeMirror editor.
- Improved sanitization and security.
- Block Editor and Classic Editor compatibility.
- Performance optimizations.
- Updated documentation.

