Head, Footer and Post Injections


About WordPress SEO and Facebook Open Graph: I was very unpleased by Yoast invitation to
remove my plugin, and it’s not the case.
Read more here.

Head and Footer Codes

Why you have to install 10 plugins to add Google Analytics, Facebook Pixel, custom
tracking code, Google DFP code, Google Webmaster/Alexa/Bing/Tradedoubler verification code and so on…

With Header and Footer plugin you can just copy the code those services give you
in a centralized point to manage them all. And theme independent: you can change your theme
without loosing the code injected!

Injection points and features

  • in the page section where most if the codes are usually added
  • just after the tag as required by some JavaScript SDK (like Facebook)
  • in the page footer (just before the tag)
  • recognize and execute PHP code to add logic to your injections
  • distinct desktop and mobile injections


A new AMP dedicated section compatible with AMP plugin lets you to inject specific codes in
AMP pages.

Post Top and Bottom Codes

Do you need to inject a banner over the post content or after it? No problem. With Header and
Footer you can:

  • Add codes on top, bottom and in the middle of posts and pages
  • Differentiate between mobile and desktop (you don’t display the same ad format on both, true?)
  • Separate post and page configuration
  • Native PHP code enabled
  • Shortcodes enabled

Special Injections

  • Just after the opening BODY tag
  • In the middle of post content (using configurable rules)
  • Everywhere on template (using placeholders)


The specific bbPress injections are going to be removed. Switch to my
Ads for bbPress, which is more flexible and complete.


This plugin cannot change the menu or the footer layout, those features must be covered by your theme!

Official page: Header and Footer.

Other plugins by Stefano Lissa:

Privacy and GDPR

This plugin does not collect or process any personal user data.


  • Configuration panel for blog HEAD and footer sections
  • Configuration panel for post content
  • Configuration panel for Facebook "og" tags
  • Configurable snippets of code to be recalled on other configurations (to save time)


  1. Put the plugin folder into [wordpress_dir]/wp-content/plugins/
  2. Go into the WordPress admin interface and activate the plugin
  3. Optional: go to the options page and configure the plugin

Preguntas frecuentes

FAQs are answered on Header and Footer page.

Installation Instructions
  1. Put the plugin folder into [wordpress_dir]/wp-content/plugins/
  2. Go into the WordPress admin interface and activate the plugin
  3. Optional: go to the options page and configure the plugin



Does exactly what it says it will do. Have been using this for years without any issue whatsoever.

I’m satisfied!

just copy & paste, verified to Google Search Console, done! Wonderful, no need coding knowledge at all !!! Thanks a lot for this plugin.

This plug-in rocks.

This plugin allowed me to add a social media toolbar that uses font-awesome icons to a theme which wouldn't allow editing of the header and footer. This is an awesome help!
Leer todas las 473 reseñas

Colaboradores y desarrolladores

“Head, Footer and Post Injections” es un software de código abierto. Las siguientes personas han colaborado con este plugin.


Traduce “Head, Footer and Post Injections” a tu idioma.

¿Interesado en el desarrollo?

Revisa el código , echa un vistazo al repositorio SVN , o suscríbete al log de desarrollo por RSS .

Registro de cambios


  • Fixed a debug notice


  • Privacy section in the readme.txt


  • Removed the Facebook setting (move to a specialized plugin to have the Facebook Open Graph Meta)
  • Removed bbPress setting (please use bbpress ads)
  • Label fix
  • Removed notices
  • 5 post injections and 5 generic injections


  • Added the filter “hefo_php_exec” to let a third party to disable the PHP execution


  • Moved the donate png inside the plugin


  • Debug notices fix


  • Debug notices fix


  • Check on content length for injections “skipping” N characters
  • Removed obsolete code
  • Removed script handlers debugger
  • Fixed notice on $post_id


  • Version error (grrr)


  • Fixed an error on menu
  • Added the subscription box
  • Fixed CSS and JS in admin panel


  • Start adding support for amp and amp plugin
  • Removed the Open Graph support (it is now so complex that it became out of scope for this plugin)
  • Add a notice to use Ads for bbPress
  • Home page only injection fix
  • Removed old code
  • Little change to the name to be more descriptive
  • Removed local codemirror and added the one from cdnjs


  • Fixed generics injection tab
  • Fixed mobile footer version
  • Fixed few debug notices


  • Fixed mobile detection injection


  • CodeMirror introduced
  • Better mobile code differentiation
  • Admin interface fixes


  • Reverted 1.6.9 changes which break the blog in some cases


  • PHP execution added to the after “body tag” injection


  • Fixed a debug notice
  • Updated readme.txt


  • Added the just after tag injection


  • Fixed few debug notices
  • Fixed the top and bottom injection controls from post and page editing panels


  • Added a web performance section to force async load of selected JavaScript files


  • Comptibility check


  • Added the css id removal feature for pagespeed. See this page.


  • Notas
  • Performance improvements


  • Code cleanup
  • New notes


  • Added options to remove some head links


  • Sticky plugin removed
  • Compatibility check with WP 4.0
  • Code improvements on buffering


  • Removed a couple of obsolete lines of code
  • Added options to enable tags and categories on pages


  • Fixed a notice for 404 page


  • Version compatibility


  • Added an option to use the post options for pages


  • Fixed the “global post” variable when injections contain php


  • Fixed a link


  • Fixed a debug notice


  • Fixed some debug notices
  • ru_RU translation by Eugene Zhukov
  • Added the “thank you” panel
  • Fixed the missing user agent notice


  • Mobile detection added


  • Full size og:image
  • Improved the bbpress integration


  • Fixed a debug warning


  • Performance improvements


  • Added top and bottom injection controls on single posts and pages


  • Added global variables “hefo_page_top”, “hefo_page_bottom” that, if set to false, blocks the page injection
  • Added global variables “hefo_post_top”, “hefo_post_bottom” that, if set to false, blocks the page injection
  • Added configuration to inject code on excerpts
  • Added global variable $hefo_count which counts the number of process excerpts


  • Chaged the top bar
  • Fixed some CSS


  • Added a SEO option for noindex meta tag on page 2 and up of the home page
  • Added a SEO option for canonical on home page (save you from URLs with query string parameter used by plugins)
  • Added a SEO option for noindex meta tag on seach result pages


  • Removed the init configuration, too much dangerous


  • Added the init configuration


  • Added notes and parked codes
  • Added code snippets
  • $post made global for post and page header and footer


  • Added an important note about tabs and image selection on the facebook tab, only informative
  • Added a .po file, but it is no still time to translate!


  • Fixed the not loading CSS and sone layout problems


  • Fixed the readme file…
  • Fixed some labels
  • Added the screenshots (hope they’ll show up this time…)


  • Added bbPress “compatibility” for og:image Facebook meta tag
  • Administration panel tabbed
  • Added Facebook og:type support
  • Fix the og:image on home page when there is no default image specified
  • Facebook og: tags added earlier on head section that other codes


  • added configuration to inject code before and after pages
  • small graphical changes


  • compatibility check with WordPress 3.2.1
  • updated the Facebook Open Graph image tag (og:image)
  • integrated with WordPress media gallery image picker and uploader
  • some CSS changes
  • added the Satollo.net news iframe
  • added configurations to inject code before and after posts
  • added a PDF manual


  • WP 2.7.1 compatibility check


  • added the german translation by Ev. Jugend Schwandorf – Sebastian M�ller (http://www.ej-schwandorf.de)


  • fixed the usage of short php tag


  • added the “only home” header text