WP Manifestindependent plugin directory
manifest / utilities / wp-header-footer-injector

WP Header & Footer Code Injector

A lightweight and secure WordPress plugin to easily inject custom JavaScript, CSS, or HTML into your site’s header and footer. Includes enable/disable toggle, translation-ready placeholders, and works without touching theme files. Perfect for analytics, tracking, and custom scripts.

★ 1stars

Install

Download source zip No release zip yet

This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.

Install straight from GitHub with WP-CLI:

wp plugin install https://github.com/aminulsarkar/wp-header-footer-injector/archive/refs/heads/main.zip
No built-in updater. New versions won't appear under Dashboard → Updates. Install new releases yourself, or let Git Updater track the repository.

Easily add custom scripts to WordPress header and footer without editing theme files. This plugin is lightweight, secure, and fully translation-ready. Perfect for Google Analytics, Facebook Pixel, custom CSS, or any JavaScript code. Includes enable/disable toggle and placeholder guidance for non-technical users.


Features

  • Inject custom header and footer code safely
  • Enable/disable toggle to activate/deactivate injection
  • Translation-ready for internationalization
  • Guided placeholders for JS and CSS examples
  • Works with any theme without modifying theme files
  • Sanitized inputs to prevent malicious code
  • Fully compatible with modern WordPress and PHP versions

Installation

  1. Upload the plugin folder to /wp-content/plugins/
  2. Activate the plugin through Plugins > Installed Plugins
  3. Navigate to the Header & Footer menu in the WordPress sidebar
  4. Add your code in the header or footer textarea
  5. Enable or disable injection using the toggle and save changes

Usage

  • Header Code: Scripts injected inside <head>
  • Body Open Code: Scripts injected right after <body>
  • Footer Code: Scripts injected before </body>
  • Placeholders show example JavaScript and CSS for guidance
  • Toggle to enable or disable code injection easily

Requirements

  • WordPress 5.0+
  • PHP 5.6+ (recommended 7.4+)

Screenshots

  1. Admin settings page with header/footer textareas
  2. Enable/disable toggle
  3. Example of placeholder guidance

Changelog

1.0.0 – Initial release

  • Fully functional header & footer code injection
  • Enable/disable toggle
  • Translation-ready
  • Placeholder guidance included

License

This plugin is released under the GPLv2 or later.


Author

Aminul Sarkar – aminulsarkar.com