Title: Header Footer Script Adder – Insert Code in Header, Body &amp; Footer
Author: mahethekiller
Published: <strong>2 de Febreiro, 2017</strong>
Last modified: 5 de Xuño, 2026

---

Buscar plugins

![](https://ps.w.org/header-and-footer-script-adder/assets/banner-772x250.png?rev
=3321624)

![](https://ps.w.org/header-and-footer-script-adder/assets/icon-128x128.png?rev=
3321624)

# Header Footer Script Adder – Insert Code in Header, Body & Footer

 Por [mahethekiller](https://profiles.wordpress.org/mahethekiller/)

[Descargar](https://downloads.wordpress.org/plugin/header-and-footer-script-adder.2.0.7.zip)

 * [Detalles](https://gl.wordpress.org/plugins/header-and-footer-script-adder/#description)
 * [Valoracións](https://gl.wordpress.org/plugins/header-and-footer-script-adder/#reviews)
 *  [Instalación](https://gl.wordpress.org/plugins/header-and-footer-script-adder/#installation)
 * [Desenvolvemento](https://gl.wordpress.org/plugins/header-and-footer-script-adder/#developers)

 [Soporte](https://wordpress.org/support/plugin/header-and-footer-script-adder/)

## Descrición

**Header Footer Script Adder** is a lightweight, highly secure, and performance-
optimized WordPress plugin that lets you easily insert **custom HTML, CSS, and JavaScript**
into your site’s header, body, or footer without editing theme files.

Stop modifying your theme’s `header.php` or `footer.php` files directly! When you
change or update your theme, your crucial marketing, analytics, and tracking codes
remain safely stored and active.

The **Free Version** gives you immediate, bloat-free global text areas to inject
your scripts across your site, while the **Pro Version** unlocks a complete, developer-
grade Tag Management System to control exactly _how_, _when_, and _for whom_ your
scripts execute.

### ✨ Free Core Features

 * **Targeted Placements:** Add scripts precisely to the Header (`<head>`), Body(
   immediately after `<body>` via `wp_body_open`), or Footer (before `</body>`).
 * **Smart Conditional Loading:** Control script visibility sitewide, homepage only,
   posts/pages only, or archive pages.
 * **Per-Page & Per-Post Overrides:** Inject completely unique tracking codes or
   custom scripts into specific individual posts or pages.
 * **Developer-Grade Code Editor:** Built-in CodeMirror code editor with full syntax
   highlighting for error-free coding.
 * **Secure Input Handling:** Robust input sanitization without breaking valid HTML,
   CSS, or JS scripts.
 * **Lightweight & Fast:** Zero bloat architecture that minimizes database queries
   to protect front-end site speed.
 * **Full Compatibility:** Works seamlessly with the Block Editor (Gutenberg), Classic
   Editor, and WordPress Multisite installations.

### ✅ Perfect For

 * **Analytics & SEO:** Google Analytics / GA4 tracking code, Google Tag Manager(
   GTM), and SEO verification meta tags (Google Search Console, Bing, Pinterest).
 * **Conversion Tracking:** Meta (Facebook) Pixel, TikTok Pixel, Pinterest Tag, 
   and ad tracking scripts.
 * **User Engagement:** Live chat widgets (WhatsApp, Crisp, Tawk.to, HubSpot).
 * **Custom Styling & Scripts:** Global or page-specific custom CSS modifications
   and JavaScript actions.

### 🚀 Upgrade to Pro: Unlock Ultimate Control & Speed

For advanced developers, agencies, and e-commerce stores, the Pro version transforms
your setup into an advanced tracking engine:

 * **1. Granular Conditional Targeting:**
    - **User Role Targeting:** Load scripts for Everyone, Logged-In Users Only, 
      Logged-Out Users Only, or specific roles (Administrator, Subscriber, WooCommerce
      Customer, etc.).
    - **Device Targeting:** Optimize layouts by choosing to load scripts only on
      Desktop, Tablet, or Mobile devices.
    - **Advanced Page-Specific Targeting:** Target specific Custom Post Types or
      key WooCommerce Pages (Shop, Cart, Checkout, Single Products) to eliminate
      checkout tracking discrepancies.
 * **2. Core Web Vitals & Performance Optimization:**
    - **Loading Strategies:** Automatically inject `async` (non-blocking) or `defer`(
      delayed execution) attributes into scripts to skyrocket your Google PageSpeed
      scores.
    - **Flexible Injection Methods:** Print code Inline directly to the page, or
      as an Enqueued File to take advantage of browser caching.
    - **Automatic Code Minification:** Automatically strips comments and whitespace
      from your custom snippets to reduce payload size.
 * **3. One-Click Native Pixel Integrations:**
    No more copying messy code blocks.
   Simply paste your tracking IDs for optimized, automated deployment of:
    - **Google Tag Manager (GTM):** Automated header script and body `<noscript>`
      fallback setup.
    - **Google Analytics 4 (GA4):** Cleanly enqueues the modern Global Site Tag (`
      gtag.js`).
    - **Meta Facebook Pixel:** Automated base header code and noscript image tag
      fallback.
 * **4. Complete Snippet Management System (CPT):**
    Move beyond global boxes into
   an organized, custom post type management engine:
    - **Unlimited Isolated Snippets:** Create distinct, named snippets for individual
      marketing campaigns instead of mixing all code together.
    - **Execution Priority Control:** Assign execution weights (e.g., Priority 10
      vs 50) to strictly command the exact order scripts print to the page.
    - **Instant Status Toggles:** Safely toggle individual snippets Active or Inactive
      with a single click without deleting your code.

### 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 official support
forum on WordPress.org.

### Privacy Policy

This plugin does not collect or share personal data. It only safely loads the scripts
you explicitly provide. Any data processing relies entirely on the external scripts
you choose to implement (e.g., Google Analytics, Facebook Pixel).

## Capturas

 * [[
 * **Main Settings Page** – Add scripts globally.
 * [[
 * **Code Editor** – Syntax highlighting for easy editing.

## Instalación

 1. Go to your WordPress Dashboard, navigate to **Plugins  Add New**, and search for**
    Header Footer Script Adder**.
 2. Click **Install Now** and then **Activate** the plugin.
 3. Access the configuration dashboard by navigating to **Settings  Header Footer Script
    Adder** in your admin menu.
 4. Paste your code snippets, configure your loading conditions, and click Save.

#### Manual Installation via ZIP

 1. Download the plugin `.zip` file from the WordPress repository.
 2. In your WordPress Admin, go to **Plugins  Add New  Upload Plugin** and select the
    zip file.
 3. Install, activate, and navigate to **Settings  Header Footer Script Adder** to 
    begin.

## Preguntas frecuentes

### Is this plugin safe to use?

Yes. All inputs are sanitized, and access is restricted strictly to administrators
to prevent unauthorized script injections. It strictly adheres to WordPress core
security standards.

### Will it slow down my website performance?

Not at all. The plugin is intentionally lightweight and optimized. Scripts are only
queried and executed on the specific pages you designate via conditional formatting.

### Can I add scripts to a single page only?

Yes. You can use the per-page override settings directly within the post or page
editor sidebar to inject exclusive scripts.

### Does it support Gutenberg (Block Editor)?

Yes. It is fully compatible with both the modern Gutenberg Block Editor and the 
legacy Classic Editor interface.

### Can I run this on a WordPress Multisite network?

Yes. The plugin is multisite ready, allowing each sub-site on your network to maintain
its own independent script configuration.

### Can I insert multiple scripts into the same section?

Yes. You can paste multiple independent scripts (e.g., Google Analytics and Facebook
Pixel together) sequentially into the header, body, or footer areas.

### Will my tracking codes disappear if I switch my theme?

No. All codes are securely written into the WordPress database, meaning you can 
swap, edit, or update themes without ever losing your tracking configurations.

### How do I remove plugin data completely?

Upon uninstallation, the plugin provides a clean teardown option to wipe all saved
script configurations completely from your database.

### Will adding tracking pixels slow down my Core Web Vitals?

Third-party scripts are the #1 cause of poor mobile page speed. While the Free version
prints scripts exactly as you paste them, the Pro version includes built-in optimization
tools. You can apply “Async” or “Defer” tags to your scripts with a single click,
or force them to load as enqueued files to maintain blazing-fast loading speeds 
and high Google PageSpeed scores.

### How do I upgrade to the Pro version?

Upgrading is completely seamless. Once you are ready to unlock advanced targeting
and optimization, navigate to the “Header Footer Script Adder” menu in your WordPress
dashboard and click on the “Upgrade” or “Go Pro” tab to securely purchase and instantly
activate your premium license via Freemius without losing any of your existing scripts.

## Comentarios

![](https://secure.gravatar.com/avatar/d6b684c8707eef3aec1154e87cc7b206b1d4c0a810ad15844e67f36b23a37623?
s=60&d=retro&r=g)

### 󠀁[Per page additions & great support](https://wordpress.org/support/topic/per-page-additions-great-support/)󠁿

 [someguycalledralph](https://profiles.wordpress.org/someguycalledralph/) 24 de 
Outubro, 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!

![](https://secure.gravatar.com/avatar/f0c1ae1f239fba7c73e0cd6a8f4a9576d9dc6279cb4ab594ddcf4ce7276742dc?
s=60&d=retro&r=g)

### 󠀁[Simple and Reliable](https://wordpress.org/support/topic/simple-and-reliable-66/)󠁿

 [roimantra](https://profiles.wordpress.org/roimantra/) 19 de Xuño, 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!

![](https://secure.gravatar.com/avatar/00025ab4577f3933fd6a01823f20b2a7d18adb73e79fbccdb2a48453825e3cf5?
s=60&d=retro&r=g)

### 󠀁[Plugin Review: Header and Footer Script Adder](https://wordpress.org/support/topic/plugin-review-header-and-footer-script-adder/)󠁿

 [abhishekkk](https://profiles.wordpress.org/abhishekkk/) 19 de Xuño, 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.

![](https://secure.gravatar.com/avatar/c39613a7f0113cd70232aaf783f6ae04f27ccf68aa4df45a4a09bdd3c33c8794?
s=60&d=retro&r=g)

### 󠀁[Plugin Works As described](https://wordpress.org/support/topic/plugin-works-as-described-3/)󠁿

 [m254032](https://profiles.wordpress.org/m254032/) 19 de Xuño, 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.

![](https://secure.gravatar.com/avatar/810d42d26127d30cbc4f9b4e496c1c3637e7c4cc3fa9f0201ea043243dd9f583?
s=60&d=retro&r=g)

### 󠀁[Invasive & spammy donation requests on every page](https://wordpress.org/support/topic/invasive-spammy-donation-requests-on-every-page/)󠁿

 [kermit666](https://profiles.wordpress.org/kermit666/) 13 de Marzo, 2017 1 resposta

This is the reason I’m getting more and more frustrated with WordPress. Can’t add
a simple <script> element to my site, without having to paddle through 5 lousy plugins…
This plugin does fulfil its simple role (that I wouldn’t even need if WordPress 
had built in some elementary HTML customisation), but somehow decided that it’s 
appropriate to spam me and other admins with requests for donations on every dashboard
page that we open – and I couldn’t disable this without deleting the plugin. Look,
I understand you want to make some cash, but then please clearly mark this as freemium
or make it a paid thing. This thing you’re doing now is just plain rude.

 [ Ler todas as 4 opinións ](https://wordpress.org/support/plugin/header-and-footer-script-adder/reviews/)

## Colaboradores e desenvolvedores

“Header Footer Script Adder – Insert Code in Header, Body & Footer” é un software
de código aberto. As seguintes persoas colaboraron con este plugin.

Colaboradores

 *   [ mahethekiller ](https://profiles.wordpress.org/mahethekiller/)
 *   [ Freemius ](https://profiles.wordpress.org/freemius/)

[Traduce “Header Footer Script Adder – Insert Code in Header, Body & Footer” ao teu idioma.](https://translate.wordpress.org/projects/wp-plugins/header-and-footer-script-adder)

### Interesado no desenvolvemento?

[Revisa o código](https://plugins.trac.wordpress.org/browser/header-and-footer-script-adder/),
bota unha ollada ao[repositorio SVN](https://plugins.svn.wordpress.org/header-and-footer-script-adder/),
ou subscríbete ao [log de desenvolvemento](https://plugins.trac.wordpress.org/log/header-and-footer-script-adder/)
por [RSS](https://plugins.trac.wordpress.org/log/header-and-footer-script-adder/?limit=100&mode=stop_on_copy&format=rss).

## Rexistro de cambios

#### 2.0.7

 * Converted plugin architecture to a unified Single Version Model.
 * Integrated Freemius SDK for secure premium features delivery.
 * Added Pro Version upgrade dashboard and conditionally-loaded premium code structure.
 * Verified compatibility with latest WordPress version 6.7.

#### 2.0.6

 * Fixed a few security issues.

#### 2.0.5

 * Minor bug fixes and improvements.

#### 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.

#### 1.2.0

 * Added new features and bug fixes.
 * Improved UI for easier code management.

#### 1.0.0

 * Initial release.

## Meta

 *  Versión **2.0.7**
 *  Última actualización **Fai 8 horas**
 *  Instalacións activas **1.000+**
 *  Versión de WordPress ** 6.0 ou superior **
 *  Probado ata **6.9.4**
 *  Versión de PHP ** 7.4 ou superior **
 *  Idioma
 * [English (US)](https://wordpress.org/plugins/header-and-footer-script-adder/)
 * Etiquetas
 * [Facebook Pixel](https://gl.wordpress.org/plugins/tags/facebook-pixel/)[google analytics](https://gl.wordpress.org/plugins/tags/google-analytics/)
   [header footer](https://gl.wordpress.org/plugins/tags/header-footer/)[insert code](https://gl.wordpress.org/plugins/tags/insert-code/)
 *  [Vista avanzada](https://gl.wordpress.org/plugins/header-and-footer-script-adder/advanced/)

## Valoracións

 4 de 5 estrelas

 *  [  3 valoracións de 5 estrelas     ](https://wordpress.org/support/plugin/header-and-footer-script-adder/reviews/?filter=5)
 *  [  1 valoración de 4 estrelas     ](https://wordpress.org/support/plugin/header-and-footer-script-adder/reviews/?filter=4)
 *  [  0 valoracións de 3 estrelas     ](https://wordpress.org/support/plugin/header-and-footer-script-adder/reviews/?filter=3)
 *  [  0 valoracións de 2 estrelas     ](https://wordpress.org/support/plugin/header-and-footer-script-adder/reviews/?filter=2)
 *  [  1 valoración de 1 estrelas     ](https://wordpress.org/support/plugin/header-and-footer-script-adder/reviews/?filter=1)

[Your review](https://wordpress.org/support/plugin/header-and-footer-script-adder/reviews/#new-post)

[Ver todas as valoracións](https://wordpress.org/support/plugin/header-and-footer-script-adder/reviews/)

## Colaboradores

 *   [ mahethekiller ](https://profiles.wordpress.org/mahethekiller/)
 *   [ Freemius ](https://profiles.wordpress.org/freemius/)

## Soporte

Tes algo que dicir? Necesitas axuda?

 [Ver o foro de soporte](https://wordpress.org/support/plugin/header-and-footer-script-adder/)

## Doar

Queres apoiar o progreso deste plugin?

 [ Dona a este plugin ](https://www.buymeacoffee.com/mahethekiller)