{"id":1188,"date":"2014-02-20T08:17:49","date_gmt":"2014-02-20T08:17:49","guid":{"rendered":"https:\/\/wordpress.org\/plugins-wp\/header-and-footer-scripts\/"},"modified":"2026-02-01T05:02:49","modified_gmt":"2026-02-01T05:02:49","slug":"header-and-footer-scripts","status":"publish","type":"plugin","link":"https:\/\/mn.wordpress.org\/plugins\/header-and-footer-scripts\/","author":13420217,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_crdt_document":"","version":"2.4.2","stable_tag":"2.4.2","tested":"6.9.4","requires":"4.6","requires_php":"5.6","requires_plugins":null,"header_name":"Header and Footer Scripts","header_author":"Anand Kumar","header_description":"","assets_banners_color":"0094da","last_updated":"2026-02-01 05:02:49","external_support_url":"","external_repository_url":"","donate_link":"https:\/\/github.com\/anandkumar\/header-and-footer-scripts","header_plugin_uri":"https:\/\/github.com\/anandkumar\/header-and-footer-scripts","header_author_uri":"http:\/\/www.anandkumar.net","rating":4.6,"author_block_rating":0,"active_installs":200000,"downloads":1656424,"num_ratings":58,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","faq","changelog"],"tags":{"1.3.2":{"tag":"1.3.2","author":"BlogSynthesis","date":"2016-02-13 16:15:52"},"1.3.4":{"tag":"1.3.4","author":"BlogSynthesis","date":"2017-12-03 09:24:47"},"2.0.0":{"tag":"2.0.0","author":"anand_kumar","date":"2018-01-08 18:10:46"},"2.1.0":{"tag":"2.1.0","author":"anand_kumar","date":"2019-07-02 14:37:50"},"2.1.1":{"tag":"2.1.1","author":"anand_kumar","date":"2019-07-02 14:37:50"},"2.2.1":{"tag":"2.2.1","author":"anand_kumar","date":"2020-04-26 19:39:33"},"2.2.2":{"tag":"2.2.2","author":"anand_kumar","date":"2025-01-12 17:36:03"},"2.3.0":{"tag":"2.3.0","author":"anand_kumar","date":"2026-01-19 14:47:31"},"2.4.1":{"tag":"2.4.1","author":"anand_kumar","date":"2026-01-30 12:21:07"},"2.4.2":{"tag":"2.4.2","author":"anand_kumar","date":"2026-02-01 05:02:49"}},"upgrade_notice":{"":"<p>Upgrade for more functionality and bug fixes.<\/p>"},"ratings":{"1":2,"2":3,"3":4,"4":1,"5":48},"assets_icons":{"icon-128x128.png":{"filename":"icon-128x128.png","revision":1799457,"resolution":"128x128","location":"assets","locale":""},"icon-256x256.png":{"filename":"icon-256x256.png","revision":1799457,"resolution":"256x256","location":"assets","locale":""}},"assets_banners":{"banner-1544x500.png":{"filename":"banner-1544x500.png","revision":1799457,"resolution":"1544x500","location":"assets","locale":""},"banner-772x250.png":{"filename":"banner-772x250.png","revision":1799457,"resolution":"772x250","location":"assets","locale":""}},"assets_blueprints":{},"all_blocks":[],"tagged_versions":["1.3.2","1.3.4","2.0.0","2.1.0","2.1.1","2.2.1","2.2.2","2.3.0","2.4.1","2.4.2"],"block_files":[],"assets_screenshots":{"Screenshot-1.png":{"filename":"Screenshot-1.png","revision":861488,"resolution":"1","location":"assets","locale":""},"Screenshot-2.png":{"filename":"Screenshot-2.png","revision":861488,"resolution":"2","location":"assets","locale":""}},"screenshots":{"1":"Access this page from <code>Dashboard --&gt; Settings --&gt; Header and Footer Scripts<\/code>","2":"This box will appear below the compose box on posts and pages. If not please refer to [our docs][4] if it's not there."},"jetpack_post_was_ever_published":false},"plugin_section":[],"plugin_tags":[2640,3195,1431,86,2864],"plugin_category":[36,59],"plugin_contributors":[78750,254420],"plugin_business_model":[],"class_list":["post-1188","plugin","type-plugin","status-publish","hentry","plugin_tags-footer","plugin_tags-head","plugin_tags-header","plugin_tags-post","plugin_tags-scripts","plugin_category-analytics","plugin_category-utilities-and-tools","plugin_contributors-anand_kumar","plugin_contributors-jamify","plugin_committers-anand_kumar","plugin_support_reps-rupaprajapati"],"banners":{"banner":"https:\/\/ps.w.org\/header-and-footer-scripts\/assets\/banner-772x250.png?rev=1799457","banner_2x":"https:\/\/ps.w.org\/header-and-footer-scripts\/assets\/banner-1544x500.png?rev=1799457","banner_rtl":false,"banner_2x_rtl":false},"icons":{"svg":false,"icon":"https:\/\/ps.w.org\/header-and-footer-scripts\/assets\/icon-128x128.png?rev=1799457","icon_2x":"https:\/\/ps.w.org\/header-and-footer-scripts\/assets\/icon-256x256.png?rev=1799457","generated":false},"screenshots":[{"src":"https:\/\/ps.w.org\/header-and-footer-scripts\/assets\/Screenshot-1.png?rev=861488","caption":"Access this page from <code>Dashboard --&gt; Settings --&gt; Header and Footer Scripts<\/code>"},{"src":"https:\/\/ps.w.org\/header-and-footer-scripts\/assets\/Screenshot-2.png?rev=861488","caption":"This box will appear below the compose box on posts and pages. If not please refer to [our docs][4] if it's not there."}],"raw_content":"<!--section=description-->\n<p>An essential WordPress plugin to easily insert scripts and styles (like Google Analytics, CSS, etc.) into your website's header and footer.<\/p>\n\n<p>Looking for a way to add Google Analytics, Facebook Pixel, or custom tracking code to your website's header or footer?<\/p>\n\n<p>Header and Footer Scripts is a simple yet powerful plugin that lets you inject code\u2014such as Google Analytics, custom CSS, Facebook Pixel, and chat widgets\u2014directly into your site's header (<code>&lt;head&gt;<\/code>) or footer.<\/p>\n\n<p>No bloat, no ads. This lightweight plugin simply does what it says: inserts code into your header and footer efficiently.<\/p>\n\n<p>All you have to do is add the appropriate HTML code.<\/p>\n\n<p>Don't forget to wrap your code with proper tags.<\/p>\n\n<pre><code>&lt;script type=\"text\/javascript\"&gt;\nYOUR JS CODE HERE\n&lt;\/script&gt;\n<\/code><\/pre>\n\n<p>Or for CSS:<\/p>\n\n<pre><code>&lt;style type=\"text\/css\"&gt;\nYOUR CSS CODE HERE\n&lt;\/style&gt;\n<\/code><\/pre>\n\n<h4>Why use this plugin:<\/h4>\n\n<ul>\n<li>Insert scripts globally into the header and footer of your entire website.<\/li>\n<li>Supports all script types including HTML, JavaScript, and CSS.<\/li>\n<li>Add specific scripts to the header of individual posts or pages.<\/li>\n<li>To insert code to Custom Post Type [New Feature].<\/li>\n<\/ul>\n\n<p>The plugin should be compatible with WooCommerce.<\/p>\n\n<h4>What it does not offer<\/h4>\n\n<ul>\n<li>You can't insert\/execute PHP codes.<\/li>\n<\/ul>\n\n<p>Almost all WordPress themes support this \"Header and Footer Scripts\" plugin. If the codes are not appearing in your site [ask for support] or look at your theme file if they have standard <code>wp_head<\/code> and <code>wp_footer<\/code> hooks.<\/p>\n\n<h4>Important Links<\/h4>\n\n<p>For further information you are welcomed to follow these links:<\/p>\n\n<ul>\n<li><strong><a href=\"https:\/\/github.com\/anandkumar\/header-and-footer-scripts\/wiki\">Read Documentation<\/a><\/strong><\/li>\n<li><strong><a href=\"https:\/\/wordpress.org\/support\/plugin\/header-and-footer-scripts\/\">Get Support<\/a><\/strong><\/li>\n<li><strong><a href=\"https:\/\/github.com\/anandkumar\/header-and-footer-scripts\">GitHub Repository<\/a><\/strong><\/li>\n<\/ul>\n\n<!--section=installation-->\n<p>There is nothing special about installation of this plugin. It is as simple as uploading the plugin files to your plugins directory.<\/p>\n\n<p>Upload the plugin to <code>\/wp-content\/plugins<\/code> and activate. OR Search \"Header and Footer Scripts\" from <code>WP Dashbard --&gt; Plugins --&gt; Add New<\/code> then hit Install and then activate.<\/p>\n\n<p>Once the plugin is activated you will see \"Header and Footer Scripts\" menu item under settings of WordPress dashboard. Also a meta box on Post and Page edit page.<\/p>\n\n<!--section=faq-->\n<dl>\n<dt id=\"q.%20how%20could%20i%20access%20support%20and%20troubleshoot%20problem%3F\"><h3>Q. How could I access support and troubleshoot problem?<\/h3><\/dt>\n<dd><p>A. I couldn't handle wp.org forums on regular basis. You are suggested to visit <a href=\"https:\/\/github.com\/anandkumar\/header-and-footer-scripts\/wiki\">GitHub Wiki<\/a> for more updated plugin documentation and troubleshoot your problem.<\/p><\/dd>\n<dt id=\"q%3A%20is%20there%20any%20paid%20version%20of%20the%20plugin%20available%3F\"><h3>Q: Is there any paid version of the plugin available?<\/h3><\/dt>\n<dd><p>A. Nope, There is none. If you need more feature send us feedback or feature request.<\/p><\/dd>\n\n<\/dl>\n\n<!--section=changelog-->\n<h4>2.4.2<\/h4>\n\n<ul>\n<li>Fix: Resolved critical issue where scripts added to per-post meta box were not saving.<\/li>\n<li>Fix: Corrected CodeMirror editor rendering (borders, height) and gutter visibility (line numbers) in meta box.<\/li>\n<li>Improvement: Updated English copy throughout the plugin for better clarity and professionalism.<\/li>\n<li>New: Added Hindi (hi_IN) translation.<\/li>\n<li>New: Included language template (.pot) and translation files.<\/li>\n<\/ul>\n\n<h4>2.4.1<\/h4>\n\n<ul>\n<li>New Feature: Added \"Clean on Uninstall\" option to allow users to remove all data upon deletion.<\/li>\n<li>Fix: Resolved issue where sidebar was not loading on settings page due to deprecated constant.<\/li>\n<li>Improvement: Enhanced WPCS compliance with comprehensive DocBlocks and formatting fixes.<\/li>\n<li>Improvement: Added strict sanitization to settings authentication to resolve Plugin Check warnings.<\/li>\n<\/ul>\n\n<h4>2.4.0<\/h4>\n\n<ul>\n<li>Internal: Refactored codebase to \"Jamify HFS\" naming standards (<code>jamify_hfs_<\/code> prefix) while maintaining full backward compatibility.<\/li>\n<li>New Feature: Added support for wp_body_open hook to insert scripts immediately after body tag.<\/li>\n<li>New Feature: Added Syntax Highlighting for script editors in settings page.<\/li>\n<li>Improvement: Modernized permission system to use 'unfiltered_html' capability.<\/li>\n<li>Improvement: Added settings to allow Authors and Contributors to add scripts.<\/li>\n<li>Improvement: Added admin notice for backward compatibility migration.<\/li>\n<\/ul>\n\n<h4>2.3.1<\/h4>\n\n<ul>\n<li>Security: Hardened nonce implementation with static action names.<\/li>\n<li>Security: Added strict sanitization for access level settings.<\/li>\n<li>Security: Improved input validation with isset() checks and wp_unslash().<\/li>\n<li>Security: Replaced <strong>FILE<\/strong> menu slug to prevent path exposure.<\/li>\n<li>Security: Added security warning for privilege delegation.<\/li>\n<li>New: Added uninstall.php for clean database removal.<\/li>\n<li>Fix: Added proper ABSPATH checks to all files.<\/li>\n<li>Improvement: Added phpcs:ignore comments for intentional raw output.<\/li>\n<\/ul>\n\n<h4>2.3.0<\/h4>\n\n<ul>\n<li>Fix: Stored Cross-Site Scripting (XSS) vulnerability.<\/li>\n<li>New Feature: Add minimum capability required to add scripts to posts.<\/li>\n<\/ul>\n\n<h4>2.2.1<\/h4>\n\n<ul>\n<li>Updated readme.txt.<\/li>\n<\/ul>\n\n<h4>2.2.0<\/h4>\n\n<ul>\n<li>New feature: Now set priority to sitewide script.<\/li>\n<li>Fix: Monoscript font for text area.<\/li>\n<li>Improved readme.txt.<\/li>\n<li>Reverted to PHP v5.6 as many people can't move to latest one.<\/li>\n<\/ul>\n\n<h4>2.1.1<\/h4>\n\n<ul>\n<li>Fixed a bug causing singular post type scripts to appear in archives.<\/li>\n<li>Compatibility checked upto WordPress 5.2.2<\/li>\n<li>Now require PHP v7.0 at least.<\/li>\n<\/ul>\n\n<h4>2.1.0<\/h4>\n\n<ul>\n<li>Support to Custom Post Type (CPT).<\/li>\n<li>Improved ReadMe<\/li>\n<\/ul>\n\n<h4>2.0.1<\/h4>\n\n<ul>\n<li>Uniform Coding style.<\/li>\n<li>Improved Translatable strings.<\/li>\n<li>Fixed Links<\/li>\n<li>Code Cleanup<\/li>\n<\/ul>\n\n<h4>2.0.0<\/h4>\n\n<ul>\n<li>Visual Improvements.<\/li>\n<li>better directory structure.<\/li>\n<\/ul>\n\n<h4>1.3.4<\/h4>\n\n<ul>\n<li>Fixed variable undefined notice<\/li>\n<\/ul>\n\n<h4>1.3.3<\/h4>\n\n<ul>\n<li>Started using PHP5 style construct<\/li>\n<\/ul>\n\n<h4>1.3.2<\/h4>\n\n<ul>\n<li>Fixed https issue<\/li>\n<\/ul>\n\n<h4>1.1.0<\/h4>\n\n<ul>\n<li>Made for official WordPress Repo.<\/li>\n<li>Added Single post Header script metabox<\/li>\n<li>Minor Bug Fixes<\/li>\n<\/ul>\n\n<h4>1.0.0<\/h4>\n\n<ul>\n<li>Initial Public Release<\/li>\n<\/ul>","raw_excerpt":"Header and Footer Scripts plugin allows you to add scripts to WordPress site&#039;s  and just before closing  tag.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/mn.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/1188","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mn.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/mn.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/mn.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=1188"}],"author":[{"embeddable":true,"href":"https:\/\/mn.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/anand_kumar"}],"wp:attachment":[{"href":"https:\/\/mn.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=1188"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/mn.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=1188"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/mn.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=1188"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/mn.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=1188"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/mn.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=1188"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/mn.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=1188"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}