Insert Headers and Footers


Easily Insert Header and Footer Code

Insert Headers and Footers is a simple plugin that lets you insert code like Google Analytics, custom CSS, Facebook Pixel, and more to your WordPress site header and footer. No need to edit your theme files!

The simple interface of the Insert Headers and Footers plugin gives you one place where you can insert scripts, rather than dealing with dozens of different plugins.

Features of Insert Headers and Footers

  • Quick to set up
  • Simple to insert scripts
  • Insert header code and/or footer code
  • Add Google Analytics code to any theme
  • Add custom CSS across themes
  • Insert Facebook pixel code
  • Insert any code or script, including HTML and Javascript


This plugin is created by Syed Balkhi and the WPBeginner team.

What’s Next

If you find this plugin useful to insert header and footer scripts, please leave a good rating and consider checking out our other projects:

To learn more about WordPress, you can also visit WPBeginner for tutorials on topics like:

…and many more WordPress tutorials.


Insert Headers and Footers is the easiest way to insert code in your WordPress headers and footers.

Our goal is to make using WordPress easy, both with our WordPress plugins and resources like WPBeginner, the largest WordPress resource site for beginners.

I feel that we have done that here. I hope find Insert Headers and Footers useful to insert scripts on your site.

Thank you
Syed Balkhi


  • Settings Screen


  1. Install Insert Headers and Footers by uploading the insert-headers-and-footers directory to the /wp-content/plugins/ directory. (See instructions on how to install a WordPress plugin.)
  2. Activate Insert Headers and Footers through the Plugins menu in WordPress.
  3. Insert code in your header or footer by going to the Settings > Insert Headers and Footers menu.

Preguntas frecuentes

Can I use Insert Headers and Footers to install Google Analytics?

Yes, you can insert your Google Analytics code in the Scripts in Header field.

Can I use Insert Headers and Footers for Google AdSense?

Yes, to verify your account or to tag your page for Auto ads, paste the code AdSense gives you, into the Scripts in Header field.

How to disable Insert Headers and Footers on a specific page?

You can use one of the three available boolean filters: disable_ihaf, disable_ihaf_footer, disable_ihaf_header, disable_ihaf_body and return true value in order to disable printing either on the entire page or specifically in the header or footer of a given page.


13 de Decembro, 2019
This is exactly what I need! It is easy to use and it works perfectly for me! Thank you!
23 de Novembro, 2019
I needed this plugin to add the Google Analytics tracking code to my blog. I was able to do this, and the plugin was easy to use.
5 de Novembro, 2019
Thanks for the plugin, it's so easy to use an end-user could use it! Nicely done.
6 de Outubro, 2019
I tried to add a simple JS to the copyright in the footer. It should look like: © Copyright 2019-2019 Owner of Website's LLC. All rights Reserved. Design completed by My Company, LLC using the Divi Theme Designed by Elegant Themes | Power by WordPress The second Date will change with java script automatically each year. But instead of this, I get another section UNDER the footer with no design at all, not same colors, etc. It will not add inside the footer but BELOW it. If I try and add the whole code to the Appearance>Customize>Footer>Bottom Bar, I just see the whole code on the page. So either way, I'm unable to do any inline JS code at all.
16 de Setembro, 2019
The plugin adds code to the desktop version but not mobile. I've used another plugin and it had a field for both desktop and mobile. I tested after adding the code using your plugin and it works great on desktop, but the codes were completely not present in the mobile site. Hope you guys will update this as this plugin is considered useless in 2019.
5 de Agosto, 2019
Was looking for a long time an easy plugin to add google analytic tracking code with out to use child theme. Found this one on oceanwp admin recommendation. it does exactly the job with out usefull code. Thank you
Ler todas as 77 opinións

Colaboradores e desenvolvedores

“Insert Headers and Footers” é un software de código aberto. As seguintes persoas colaboraron con este plugin.


“Insert Headers and Footers” foron traducidas ao 13 locales. Grazas a os desenvolvedores polas súas colaboacións.

Traducir “Insert Headers and Footers” ao teu idioma.

Interesado no desenvolvemento?

Revisa o código, bota unha ollada aorepositorio SVN, ou subscríbete ao log de desenvolvemento por RSS.

Rexistro de cambios


  • Tested compatibility with WordPress 5.3.2
  • Add support for printing scripts right after the opening body tag using the wp_body_open action


  • Tested compatibility with WordPress 5.2
  • Updated text-domain standards and in plugin header


  • Update FAQs
  • Introduce three new filters: disable_ihaf, disable_ihaf_footer, disable_ihaf_header


  • Code cleanups


  • Fixes for users running PHP version less than 5.5


  • Tested with WordPress 4.7.2
  • cleaned up code


  • Tested with WordPress 4.3
  • Fix: plugin_dir_path() and plugin_dir_url() used for Multisite / symlink support


  • Fix: Dashboard widget logo URL when RSS feed cannot be loaded
  • Fix: WordPress 4.0 support
  • Added: POT language file


  • Improved settings UI for WordPress 3.8+
  • Bumped minimum version requirement


  • fixed readme file


  • cleaned up code


  • fixed unecessary CSS loading


  • Initial version