Head & Footer Code


Easy add site-wide and/or article-specific custom code before the </head> or </body> and right after opening <body> by hooking to wp_head, wp_footer and wp_body_open respectively.

Let us say that you have been told to add some custom code (HTML, JavaScript or CSS style) to page’s <head> (like site verification code, custom styles, Webfont link, etc), just before </body> or right after opening <body> (like pixel tracking, analytics code, heatmap code, etc), but you are not a programmer. Then you can use the Head & Footer Code to do that.

Simply go to ToolsHead & Footer Code in your website admin dashboard, and insert custom code to HEAD, BODY or FOOTER section (depending on what you have to do).

If you have to insert some custom code specific to the individual article (post, page, custom post type), then you can use Article specific metabox while you edit post/page/custom post type. There you can also set should that specific code be appended to site-wide code defined on ToolsHead & Footer Code, or should overwrite global code.

Features | Download | Usage | Screenshots | Reviews | References | FAQ | Support


Features

  • Set site-wide custom content for head page section (before the </head>)
  • Set site-wide custom content for body section (after the <body>)
  • Set site-wide custom content for footer page section (before the </body>)
  • Set article specific custom code for head page section (before the </head>)
  • Set article specific custom code for body section (after the <body>)
  • Set article specific custom content for footer page section (before the </body>)
  • Choose priority of printed custom code to head/body/footer sections (lower number mean far from </head> and </body> and closer to <body>, higher number means closer to </head> and </body> and farther to <body>)
  • Choose which post types will have enabled article specific head/body/footer fields
  • Choose should article specific head/body/footer code be appended to site-wide code, or will replace site-wide code
  • Site-wide section located under Tools → Head & Footer Code
  • If you have set WP_DEBUG constant in wp-config.php to true, you’ll see site-wide and article specific entries in page source code wrapped to comments.

General settings, including HEAD, BODY, FOOTER global code and priority, have been saved to the WordPress option auhfc_settings.
Each post/page/custom post type specific HEAD, BODY and FOOTER code has been saved to post meta _auhfc.

On plugin uninstall this data is also deleted from the database.

Plugin benchmark you can find on Plugins Tests


Download

You can download the plugin below or from the official WordPress.org page for Head & Footer Code while the development version can be found in GitHub repo urosevic/head-footer-code


How To Use?


Screenshots


What Users Say

Latest reviews in Q1 of the 2022 on WordPress.org for Head & Footer Code plugin
User reviews for Head & Footer Code in February and March of 2022
User reviews in January 2022 on WordPress.org for Head & Footer Code plugin
User reviews for Head & Footer Code in January 2022
User reviews in Q2/Q3 of the 2021 on WordPress.org for Head & Footer Code plugin
User reviews for Head & Footer Code in Q2/Q3 of the 2021

Head & Footer Code references


Support

If you need support for this plugin, please open the topic on the community forum.

If you finding Head & Footer Code useful for your project, please consider reviewing and rating it on WordPress.org, write an article on your blog/portal, or spread your happiness with your friends on social networks.