{"id":54004,"date":"2017-02-02T04:16:09","date_gmt":"2017-02-02T04:16:09","guid":{"rendered":"https:\/\/wordpress.org\/plugins-wp\/header-and-footer-script-adder\/"},"modified":"2026-06-05T09:50:01","modified_gmt":"2026-06-05T09:50:01","slug":"header-and-footer-script-adder","status":"publish","type":"plugin","link":"https:\/\/cn.wordpress.org\/plugins\/header-and-footer-script-adder\/","author":12019345,"comment_status":"closed","ping_status":"closed","template":"","meta":{"version":"2.0.7","stable_tag":"2.0.7","tested":"6.9.4","requires":"6.0","requires_php":"7.4","requires_plugins":null,"header_name":"Header Footer Script Adder","header_author":"mahethekiller","header_description":"","assets_banners_color":"2f85c0","last_updated":"2026-06-05 09:50:01","external_support_url":"","external_repository_url":"","donate_link":"https:\/\/www.buymeacoffee.com\/mahethekiller","header_plugin_uri":"https:\/\/wordpress.org\/plugins\/header-and-footer-script-adder","header_author_uri":"https:\/\/wordpress.org\/support\/users\/mahethekiller","rating":3.8,"author_block_rating":0,"active_installs":1000,"downloads":16148,"num_ratings":4,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","faq","changelog"],"tags":{"1.0.1":{"tag":"1.0.1","author":"mahethekiller","date":"2017-02-24 11:45:55"},"1.0.2":{"tag":"1.0.2","author":"mahethekiller","date":"2017-03-04 09:10:57"},"1.0.3":{"tag":"1.0.3","author":"mahethekiller","date":"2017-03-17 05:15:30"},"2.0.0":{"tag":"2.0.0","author":"mahethekiller","date":"2025-06-18 06:06:52"},"2.0.1":{"tag":"2.0.1","author":"mahethekiller","date":"2025-06-30 11:03:38"},"2.0.2":{"tag":"2.0.2","author":"mahethekiller","date":"2025-07-02 13:25:45"},"2.0.3":{"tag":"2.0.3","author":"mahethekiller","date":"2025-09-23 06:13:46"},"2.0.4":{"tag":"2.0.4","author":"mahethekiller","date":"2025-10-14 04:35:59"},"2.0.5":{"tag":"2.0.5","author":"mahethekiller","date":"2025-10-23 09:50:11"},"2.0.6":{"tag":"2.0.6","author":"mahethekiller","date":"2025-11-03 04:53:09"},"2.0.7":{"tag":"2.0.7","author":"mahethekiller","date":"2026-06-05 09:50:01"}},"upgrade_notice":{"2.0.6":"<p>Fixed few security issues.<\/p>","2.0.5":"<p>Fixed few issues.<\/p>","2.0.3":"<p>This is a major release. Backup your scripts before updating as older settings may be replaced.<\/p>"},"ratings":{"1":1,"2":0,"3":0,"4":1,"5":2},"assets_icons":{"icon-128x128.png":{"filename":"icon-128x128.png","revision":3321624,"resolution":"128x128","location":"assets","locale":"","width":128,"height":128}},"assets_banners":{"banner-772x250.png":{"filename":"banner-772x250.png","revision":3321624,"resolution":"772x250","location":"assets","locale":"","width":772,"height":250}},"assets_blueprints":{},"all_blocks":[],"tagged_versions":["1.0.1","1.0.2","1.0.3","2.0.0","2.0.1","2.0.2","2.0.3","2.0.4","2.0.5","2.0.6","2.0.7"],"block_files":[],"assets_screenshots":{"screenshot-1.png":{"filename":"screenshot-1.png","revision":3310383,"resolution":"1","location":"assets","locale":"","width":1326,"height":719},"screenshot-2.png":{"filename":"screenshot-2.png","revision":3310383,"resolution":"2","location":"assets","locale":"","width":1327,"height":657}},"screenshots":{"1":"<strong>Main Settings Page<\/strong> \u2013 Add scripts globally.","2":"<strong>Code Editor<\/strong> \u2013 Syntax highlighting for easy editing.","3":"<strong>Conditional Options<\/strong> \u2013 Control script placement (sitewide, homepage, archives, etc.).","4":"<strong>Per-Page Overrides<\/strong> \u2013 Unique scripts per post or page.","5":"<strong>Help Section<\/strong> \u2013 Usage instructions and FAQs."}},"plugin_section":[],"plugin_tags":[7855,1005,192138,36694,265956],"plugin_category":[],"plugin_contributors":[78154,131339],"plugin_business_model":[],"class_list":["post-54004","plugin","type-plugin","status-publish","hentry","plugin_tags-facebook-pixel","plugin_tags-google-analytics","plugin_tags-header-footer","plugin_tags-insert-code","plugin_tags-insert-headers","plugin_contributors-freemius","plugin_contributors-mahethekiller","plugin_committers-mahethekiller"],"banners":{"banner":"https:\/\/ps.w.org\/header-and-footer-script-adder\/assets\/banner-772x250.png?rev=3321624","banner_2x":false,"banner_rtl":false,"banner_2x_rtl":false},"icons":{"svg":false,"icon":"https:\/\/ps.w.org\/header-and-footer-script-adder\/assets\/icon-128x128.png?rev=3321624","icon_2x":false,"generated":false},"screenshots":[{"src":"https:\/\/ps.w.org\/header-and-footer-script-adder\/assets\/screenshot-1.png?rev=3310383","caption":"<strong>Main Settings Page<\/strong> \u2013 Add scripts globally."},{"src":"https:\/\/ps.w.org\/header-and-footer-script-adder\/assets\/screenshot-2.png?rev=3310383","caption":"<strong>Code Editor<\/strong> \u2013 Syntax highlighting for easy editing."}],"raw_content":"<!--section=description-->\n<p><strong>Header Footer Script Adder<\/strong> is a lightweight, highly secure, and performance-optimized WordPress plugin that lets you easily insert <strong>custom HTML, CSS, and JavaScript<\/strong> into your site\u2019s header, body, or footer without editing theme files.<\/p>\n\n<p>Stop modifying your theme's <code>header.php<\/code> or <code>footer.php<\/code> files directly! When you change or update your theme, your crucial marketing, analytics, and tracking codes remain safely stored and active.<\/p>\n\n<p>The <strong>Free Version<\/strong> gives you immediate, bloat-free global text areas to inject your scripts across your site, while the <strong>Pro Version<\/strong> unlocks a complete, developer-grade Tag Management System to control exactly <em>how<\/em>, <em>when<\/em>, and <em>for whom<\/em> your scripts execute.<\/p>\n\n<h3>\u2728 Free Core Features<\/h3>\n\n<ul>\n<li><strong>Targeted Placements:<\/strong> Add scripts precisely to the Header (<code>&lt;head&gt;<\/code>), Body (immediately after <code>&lt;body&gt;<\/code> via <code>wp_body_open<\/code>), or Footer (before <code>&lt;\/body&gt;<\/code>).<\/li>\n<li><strong>Smart Conditional Loading:<\/strong> Control script visibility sitewide, homepage only, posts\/pages only, or archive pages.<\/li>\n<li><strong>Per-Page &amp; Per-Post Overrides:<\/strong> Inject completely unique tracking codes or custom scripts into specific individual posts or pages.<\/li>\n<li><strong>Developer-Grade Code Editor:<\/strong> Built-in CodeMirror code editor with full syntax highlighting for error-free coding.<\/li>\n<li><strong>Secure Input Handling:<\/strong> Robust input sanitization without breaking valid HTML, CSS, or JS scripts.<\/li>\n<li><strong>Lightweight &amp; Fast:<\/strong> Zero bloat architecture that minimizes database queries to protect front-end site speed.<\/li>\n<li><strong>Full Compatibility:<\/strong> Works seamlessly with the Block Editor (Gutenberg), Classic Editor, and WordPress Multisite installations.<\/li>\n<\/ul>\n\n<h3>\u2705 Perfect For<\/h3>\n\n<ul>\n<li><strong>Analytics &amp; SEO:<\/strong> Google Analytics \/ GA4 tracking code, Google Tag Manager (GTM), and SEO verification meta tags (Google Search Console, Bing, Pinterest).<\/li>\n<li><strong>Conversion Tracking:<\/strong> Meta (Facebook) Pixel, TikTok Pixel, Pinterest Tag, and ad tracking scripts.<\/li>\n<li><strong>User Engagement:<\/strong> Live chat widgets (WhatsApp, Crisp, Tawk.to, HubSpot).<\/li>\n<li><strong>Custom Styling &amp; Scripts:<\/strong> Global or page-specific custom CSS modifications and JavaScript actions.<\/li>\n<\/ul>\n\n<h3>\ud83d\ude80 Upgrade to Pro: Unlock Ultimate Control &amp; Speed<\/h3>\n\n<p>For advanced developers, agencies, and e-commerce stores, the Pro version transforms your setup into an advanced tracking engine:<\/p>\n\n<ul>\n<li><p><strong>1. Granular Conditional Targeting:<\/strong><\/p>\n\n<ul>\n<li><strong>User Role Targeting:<\/strong> Load scripts for Everyone, Logged-In Users Only, Logged-Out Users Only, or specific roles (Administrator, Subscriber, WooCommerce Customer, etc.).<\/li>\n<li><strong>Device Targeting:<\/strong> Optimize layouts by choosing to load scripts only on Desktop, Tablet, or Mobile devices.<\/li>\n<li><strong>Advanced Page-Specific Targeting:<\/strong> Target specific Custom Post Types or key WooCommerce Pages (Shop, Cart, Checkout, Single Products) to eliminate checkout tracking discrepancies.<\/li>\n<\/ul><\/li>\n<li><p><strong>2. Core Web Vitals &amp; Performance Optimization:<\/strong><\/p>\n\n<ul>\n<li><strong>Loading Strategies:<\/strong> Automatically inject <code>async<\/code> (non-blocking) or <code>defer<\/code> (delayed execution) attributes into scripts to skyrocket your Google PageSpeed scores.<\/li>\n<li><strong>Flexible Injection Methods:<\/strong> Print code Inline directly to the page, or as an Enqueued File to take advantage of browser caching.<\/li>\n<li><strong>Automatic Code Minification:<\/strong> Automatically strips comments and whitespace from your custom snippets to reduce payload size.<\/li>\n<\/ul><\/li>\n<li><p><strong>3. One-Click Native Pixel Integrations:<\/strong>\nNo more copying messy code blocks. Simply paste your tracking IDs for optimized, automated deployment of:<\/p>\n\n<ul>\n<li><strong>Google Tag Manager (GTM):<\/strong> Automated header script and body <code>&lt;noscript&gt;<\/code> fallback setup.<\/li>\n<li><strong>Google Analytics 4 (GA4):<\/strong> Cleanly enqueues the modern Global Site Tag (<code>gtag.js<\/code>).<\/li>\n<li><strong>Meta Facebook Pixel:<\/strong> Automated base header code and noscript image tag fallback.<\/li>\n<\/ul><\/li>\n<li><p><strong>4. Complete Snippet Management System (CPT):<\/strong>\nMove beyond global boxes into an organized, custom post type management engine:<\/p>\n\n<ul>\n<li><strong>Unlimited Isolated Snippets:<\/strong> Create distinct, named snippets for individual marketing campaigns instead of mixing all code together.<\/li>\n<li><strong>Execution Priority Control:<\/strong> Assign execution weights (e.g., Priority 10 vs 50) to strictly command the exact order scripts print to the page.<\/li>\n<li><strong>Instant Status Toggles:<\/strong> Safely toggle individual snippets Active or Inactive with a single click without deleting your code.<\/li>\n<\/ul><\/li>\n<\/ul>\n\n<h3>Donations<\/h3>\n\n<p>If you enjoy this plugin and want to support development, you can buy me a coffee:\n\ud83d\udc49 https:\/\/www.buymeacoffee.com\/mahethekiller<\/p>\n\n<h3>Support &amp; Documentation<\/h3>\n\n<p>For support, feature requests, or documentation, please visit the official support forum on WordPress.org.<\/p>\n\n<h3>Privacy Policy<\/h3>\n\n<p>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).<\/p>\n\n<!--section=installation-->\n<ol>\n<li>Go to your WordPress Dashboard, navigate to <strong>Plugins \u2192 Add New<\/strong>, and search for <strong>Header Footer Script Adder<\/strong>.<\/li>\n<li>Click <strong>Install Now<\/strong> and then <strong>Activate<\/strong> the plugin.<\/li>\n<li>Access the configuration dashboard by navigating to <strong>Settings \u2192 Header Footer Script Adder<\/strong> in your admin menu.<\/li>\n<li>Paste your code snippets, configure your loading conditions, and click Save.<\/li>\n<\/ol>\n\n<h4>Manual Installation via ZIP<\/h4>\n\n<ol>\n<li>Download the plugin <code>.zip<\/code> file from the WordPress repository.<\/li>\n<li>In your WordPress Admin, go to <strong>Plugins \u2192 Add New \u2192 Upload Plugin<\/strong> and select the zip file.<\/li>\n<li>Install, activate, and navigate to <strong>Settings \u2192 Header Footer Script Adder<\/strong> to begin.<\/li>\n<\/ol>\n\n<!--section=faq-->\n<dl>\n<dt id=\"is%20this%20plugin%20safe%20to%20use%3F\"><h3>Is this plugin safe to use?<\/h3><\/dt>\n<dd><p>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.<\/p><\/dd>\n<dt id=\"will%20it%20slow%20down%20my%20website%20performance%3F\"><h3>Will it slow down my website performance?<\/h3><\/dt>\n<dd><p>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.<\/p><\/dd>\n<dt id=\"can%20i%20add%20scripts%20to%20a%20single%20page%20only%3F\"><h3>Can I add scripts to a single page only?<\/h3><\/dt>\n<dd><p>Yes. You can use the per-page override settings directly within the post or page editor sidebar to inject exclusive scripts.<\/p><\/dd>\n<dt id=\"does%20it%20support%20gutenberg%20%28block%20editor%29%3F\"><h3>Does it support Gutenberg (Block Editor)?<\/h3><\/dt>\n<dd><p>Yes. It is fully compatible with both the modern Gutenberg Block Editor and the legacy Classic Editor interface.<\/p><\/dd>\n<dt id=\"can%20i%20run%20this%20on%20a%20wordpress%20multisite%20network%3F\"><h3>Can I run this on a WordPress Multisite network?<\/h3><\/dt>\n<dd><p>Yes. The plugin is multisite ready, allowing each sub-site on your network to maintain its own independent script configuration.<\/p><\/dd>\n<dt id=\"can%20i%20insert%20multiple%20scripts%20into%20the%20same%20section%3F\"><h3>Can I insert multiple scripts into the same section?<\/h3><\/dt>\n<dd><p>Yes. You can paste multiple independent scripts (e.g., Google Analytics and Facebook Pixel together) sequentially into the header, body, or footer areas.<\/p><\/dd>\n<dt id=\"will%20my%20tracking%20codes%20disappear%20if%20i%20switch%20my%20theme%3F\"><h3>Will my tracking codes disappear if I switch my theme?<\/h3><\/dt>\n<dd><p>No. All codes are securely written into the WordPress database, meaning you can swap, edit, or update themes without ever losing your tracking configurations.<\/p><\/dd>\n<dt id=\"how%20do%20i%20remove%20plugin%20data%20completely%3F\"><h3>How do I remove plugin data completely?<\/h3><\/dt>\n<dd><p>Upon uninstallation, the plugin provides a clean teardown option to wipe all saved script configurations completely from your database.<\/p><\/dd>\n<dt id=\"will%20adding%20tracking%20pixels%20slow%20down%20my%20core%20web%20vitals%3F\"><h3>Will adding tracking pixels slow down my Core Web Vitals?<\/h3><\/dt>\n<dd><p>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.<\/p><\/dd>\n<dt id=\"how%20do%20i%20upgrade%20to%20the%20pro%20version%3F\"><h3>How do I upgrade to the Pro version?<\/h3><\/dt>\n<dd><p>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.<\/p><\/dd>\n\n<\/dl>\n\n<!--section=changelog-->\n<h4>2.0.7<\/h4>\n\n<ul>\n<li>Converted plugin architecture to a unified Single Version Model.<\/li>\n<li>Integrated Freemius SDK for secure premium features delivery.<\/li>\n<li>Added Pro Version upgrade dashboard and conditionally-loaded premium code structure.<\/li>\n<li>Verified compatibility with latest WordPress version 6.7.<\/li>\n<\/ul>\n\n<h4>2.0.6<\/h4>\n\n<ul>\n<li>Fixed a few security issues.<\/li>\n<\/ul>\n\n<h4>2.0.5<\/h4>\n\n<ul>\n<li>Minor bug fixes and improvements.<\/li>\n<\/ul>\n\n<h4>2.0.3<\/h4>\n\n<ul>\n<li>Major release.<\/li>\n<li>Added global header, body, and footer script support.<\/li>\n<li>Conditional loading (sitewide, homepage, posts, archives).<\/li>\n<li>Per-page script overrides.<\/li>\n<li>Integrated CodeMirror editor.<\/li>\n<li>Improved sanitization and security.<\/li>\n<li>Block Editor and Classic Editor compatibility.<\/li>\n<li>Performance optimizations.<\/li>\n<li>Updated documentation.<\/li>\n<\/ul>\n\n<h4>1.2.0<\/h4>\n\n<ul>\n<li>Added new features and bug fixes.<\/li>\n<li>Improved UI for easier code management.<\/li>\n<\/ul>\n\n<h4>1.0.0<\/h4>\n\n<ul>\n<li>Initial release.<\/li>\n<\/ul>","raw_excerpt":"Easily inject custom scripts and code snippets into your site\u2019s header, body, or footer. Includes a powerful Pro Snippet Manager, Core Web Vitals opti &hellip;","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/cn.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/54004","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cn.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/cn.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/cn.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=54004"}],"author":[{"embeddable":true,"href":"https:\/\/cn.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/mahethekiller"}],"wp:attachment":[{"href":"https:\/\/cn.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=54004"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/cn.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=54004"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/cn.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=54004"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/cn.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=54004"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/cn.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=54004"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/cn.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=54004"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}