Title: AddFunc Head &amp; Footer Code
Author: AddFunc
Published: <strong>1 de diciembre, 2014</strong>
Last modified: 28 de marzo, 2026

---

Search plugins

![](https://ps.w.org/addfunc-head-footer-code/assets/banner-772x250.jpg?rev=1036015)

![](https://ps.w.org/addfunc-head-footer-code/assets/icon.svg?rev=1245441)

# AddFunc Head & Footer Code

 By [AddFunc](https://profiles.wordpress.org/addfunc/)

[Download](https://downloads.wordpress.org/plugin/addfunc-head-footer-code.2.4.zip)

 * [Details](https://pe.wordpress.org/plugins/addfunc-head-footer-code/#description)
 * [Reviews](https://pe.wordpress.org/plugins/addfunc-head-footer-code/#reviews)
 *  [Installation](https://pe.wordpress.org/plugins/addfunc-head-footer-code/#installation)
 * [Development](https://pe.wordpress.org/plugins/addfunc-head-footer-code/#developers)

 [Support](https://wordpress.org/support/plugin/addfunc-head-footer-code/)

## Description

Allows administrators to add code to the `<head>` and/or footer of an individual
post (or page or other content) and/or site-wide. Ideal for scripts such as Google
Analytics conversion tracking code and any other general or page-specific JavaScript.
A very simple, reliable and lightweight plugin.

## Screenshots

 * [[
 * Simply paste your code into one of these three fields and it will be included
   on every page of your website.
 * [[
 * Add your code to these fields respectively and it will output specifically to
   this page, post or custom post type. Optionally replace or remove the site-wide
   code on any individual post or page.

## Installation

 1. Upload the entire `/addfunc-head-footer-code` folder to the `/wp-content/plugins/`
    directory
 2. Activate the plugin through the _Plugins_ menu in WordPress
 3. Add code site-wide in _Settings>Head & Footer Code_ or on individual Pages/Posts
    using the Head & Footer Code meta box when in edit mode in a page (or any post 
    type)

## FAQ

### Can I add Google Analytics or other tracking code snippets to the ⟨head⟩ tag of my website?

Yep! That’s what AddFunc Head & Footer Code is made for.

### Can I add code snippets to the ⟨head⟩ tag or footer of a specific Post or Page?

Yep! That’s what this plugin is made for.

### Does AddFunc Head & Footer Code work on custom content types, the same as they do on Posts and Pages?

For the site wide code yes, as long as the theme is set up properly with the `wp_head()`
and `wp_footer()` functions. For individual custom content type «entries» (as we’ll
call them) it will work as long as the custom content type (or custom post type 
more precisely) is set up in the standard way, so that WordPress will recognize 
that it needs to add all the usual meta boxes to it. Basically, it will work in 
a standard setup.

### Where does the Head Code output?

Wherever `wp_head()` is located in your theme.

### Where does the Body Start Code output?

Immediately after the opening `body` tag. Note: other plugins can be made to do 
the same thing and one of them has to insert before the other, so other plugins 
could theoretically insert code before AddFunc Head & Footer Code’s Body Start Code.

### Where does the Footer Code output?

Wherever `wp_footer()` is located in your theme.

### Will AddFunc Head & Footer Code work if there is no `wp_head()` or `wp_footer()` in my theme?

Wherever one of those functions is missing, your code will not be output there. 
But omitting one of them does not stop the other ones from working. AddFunc Head&
Footer Code will also save your code regardless. It just can’t output your code 
without the presence of those functions in the theme.

### Does AddFunc have a website?

Yes. [addfunc.com](http://addfunc.com/)

## Reviews

![](https://secure.gravatar.com/avatar/3b578bf6e78d3c3033b12d0be01d4a2a25beba6b230ab2640a7336fc1789dcd6?
s=60&d=retro&r=g)

### 󠀁[Dude You Are The Best!!!](https://wordpress.org/support/topic/dude-you-are-the-best/)󠁿

 [black667](https://profiles.wordpress.org/black667/) 8 de noviembre, 2019

You saved my life man. This plugin is much better than any other similar plugins(
including Insert Headers and Footer). Thanks a lot! Keep the good work!

![](https://secure.gravatar.com/avatar/b5de3d80e9a80c4dfe34a0852596b25f94859fd8e3503ed5dfba0d29c5b76cde?
s=60&d=retro&r=g)

### 󠀁[Lightweight & easy](https://wordpress.org/support/topic/lightweight-easy/)󠁿

 [anderols](https://profiles.wordpress.org/anderols/) 3 de enero, 2019 1 reply

Thanks for this plugin – I just wanted to add the Google Adsense script in the header,
and I did it in minutes…:-) Very easy to use.

![](https://secure.gravatar.com/avatar/5b5a99f1fa69be4f926b533e8e9f3d5c97e74a77df1c42c751877e8d3fa371e5?
s=60&d=retro&r=g)

### 󠀁[The most convenient of its kind](https://wordpress.org/support/topic/the-most-convenient-of-its-kind/)󠁿

 [diegocanal](https://profiles.wordpress.org/diegocanal/) 3 de enero, 2019 1 reply

There are other similar plugins I’ve used but this one wins by far. Being able to
set the priority is a very useful feature. Also a nice detail is that —apart from
allowing the addition of code in wp_head() and wp_footer()— it allows to put code
after the opening body tag too. Thanks @joerhoney!

![](https://secure.gravatar.com/avatar/cd65a523fc611334ce2b4d0b18615e441ae97eee95642e34a54aee67add3e23d?
s=60&d=retro&r=g)

### 󠀁[Perfect Solution! 1min fix for everything](https://wordpress.org/support/topic/perfect-solution-1min-fix-for-everything/)󠁿

 [Nexusway](https://profiles.wordpress.org/detoxdave/) 30 de noviembre, 2018 1 reply

Exactly what I needed, and nothing extra in my face, perfect use of the intended
design of Screen Options. Excellent for those Facebook App Meta-Tags! I have a child-
theme setup with many specialized templates and child Menus (about 10), and user-
restricted content, and etc. – This is what you are looking for 🙂

![](https://secure.gravatar.com/avatar/3837166e4c57a9bc05177b7f563bcd039cc8dd09710be816d3fb16dc94ab6dbe?
s=60&d=retro&r=g)

### 󠀁[SIMPLE & WORKS](https://wordpress.org/support/topic/simple-works-34/)󠁿

 [hackman2030](https://profiles.wordpress.org/hackman2030/) 27 de marzo, 2018 1 
reply

After testing various plugins with disappointment, this one helped me prevent my
Google Adsense on certain pages and posts with ease. Thank you to the plugin developer
for this work. Where can I donate please?

![](https://secure.gravatar.com/avatar/e0760b7d37c48dc46c23ffce823fa0ee75682b94d4aa2a13a0618dad0382d880?
s=60&d=retro&r=g)

### 󠀁[Add code made simple](https://wordpress.org/support/topic/add-code-made-simple/)󠁿

 [Candlelite](https://profiles.wordpress.org/candlelite/) 1 de noviembre, 2017 1
reply

The simplicity of this plugin is its power. Thank you for an excellent plugin which
is devoid of useless frippery.

 [ Read all 25 reviews ](https://wordpress.org/support/plugin/addfunc-head-footer-code/reviews/)

## Contributors & Developers

“AddFunc Head & Footer Code” is open source software. The following people have 
contributed to this plugin.

Contributors

 *   [ AddFunc ](https://profiles.wordpress.org/addfunc/)
 *   [ Joe Rhoney ](https://profiles.wordpress.org/joerhoney/)

[Translate “AddFunc Head & Footer Code” into your language.](https://translate.wordpress.org/projects/wp-plugins/addfunc-head-footer-code)

### Interested in development?

[Browse the code](https://plugins.trac.wordpress.org/browser/addfunc-head-footer-code/),
check out the [SVN repository](https://plugins.svn.wordpress.org/addfunc-head-footer-code/),
or subscribe to the [development log](https://plugins.trac.wordpress.org/log/addfunc-head-footer-code/)
by [RSS](https://plugins.trac.wordpress.org/log/addfunc-head-footer-code/?limit=100&mode=stop_on_copy&format=rss).

## Changelog

#### 2.4

28 Mar 2026

 * Fixes vulnerability: (Thanks to Muhammad Yudha – DJ / Wordfence) «Fix CVE-2026-
   2305: register_meta on init and sanitize meta»

#### 2.3

23 May 2019

 * Fixes a PHP notice, which appeared on the login dialog when WP_DEBUG was ON. (
   I think I actually got it this time.)

#### 2.2

23 Apr 2019

 * Fixes a PHP notice, which appeared on the login dialog when WP_DEBUG was ON. 
   Edit: not fixed, just a different error.

#### 2.1

28 Nov 2018

 * Removes the metabox from post types which are not public.

#### 2

19 Sep 2018

 * Adds… drumroll please… Body Start Code!
    - Insert code immediately after the opening `body` tag!
    - Fields for individual page/post code as well as site-wide code.
    - Optionally replace site-wide code with individual page/post code.
    - All behaves the same as head code and footer code, except for priority (no
      priority setting).
    - Note: There is no standard for opening `body` tag code in WordPress yet (contact
      me if I’m wrong). If there ever is, AddFunc Head & Footer Code may change 
      so as to conform to the standard. We don’t think this will effect performance
      in anyway, but if it does, we will let you know through this change log. If
      necessary, we may even leave this feature in place along with the new standardized
      method.

#### 1.5.1

17 Sep 2018

 * Removes individual post output on various pages:
    - archive
    - author
    - category
    - tag
    - home
    - search
    - 404

#### 1.5

13 Sep 2017

 * Adds ability to set the output priority of the head code. Thanks to John Irvine
   at [RD Technology Solutions](http://rdtechsol.com/) for the suggestion.
 * Adds ability to set the output priority of the footer code.
 * Changes the metabox to a lower priority so it sits at the bottom by default instead
   of the top. Thanks to [@enfueggo](https://wordpress.org/support/topic/lowering-metabox-priority/)
   for the suggestion.

#### 1.4

3 Apr 2017

 * Adds option for individual post code to replace the site-wide code:
    - Head and footer managed independently of each other.
    - Individual post code appends to site-wide by default.
    - Check the _Replace Site-wide Head/Footer Code_ checkbox to replace or remove
      the Site-wide code for the respective area.
 * Fixes post meta fields:
    - No longer saves post meta fields when not needed.
    - Deletes post meta fields if empty when saved/updated.

#### 1.3

23 Jun 2015

 * Corrects the generated path to options.php, so that the settings page can be 
   found even on installs where the plugins directory is not at the standard /wp-
   content/plugins location.

#### 1.2

19 Jun 2015

 * Discovered addfunc-head-footer-code.php was saved with text encoding Western (
   Mac OS Roman). ~>:( Changed to Unicode (UTF-8).
 * This was probably changed during a recent update on the plugin’s tags (the tags
   for the WordPress Plugin Repository), so maybe two weeks ago. Previous downloads
   should have been UTF-8.
 * Also changed version 1.1 to UTF-8 because leaving a Mac OS Roman version in the
   repository would be pointless. So 1.1 and 1.2 are the same, except for the readme.
   txt.

#### 1.1

28 Nov 2014

 * Fixes meta box nounce.
 * Changes all references to Average (including but not limited to «avrg», «average»,
   etc.) to relate to AddFunc (changing project name).
 * Changes a few other function and variable names for namespacing purposes.
 * Submitted to the WordPress Plugin Repository under the name AddFunc.

#### 1.0

7 Aug 2014

 * Includes readme.txt.
 * Submitted to the WordPress Plugin Repository.

#### 0.4.1

6 Aug 2014

 * Code cleaned up (mostly comments removed).
 * Excludes unnecessary file: style.css.

#### 0.4

8 Jul 2014

 * Bug fix: replaced «my-meta-box-id» with «avrghdftrcdMetaBox» (duh).

#### 0.3

27 Oct 2013

 * Hid Head & Footer Code meta box from non-admin users.

#### 0.2

15 Oct 2013

 * Adds a Head & Footer Code settings page for site-wide code (for admins only).

#### 0.1

14 Aug 2013

 * Adds Head & Footer Code meta box to all pages, posts and cusom post types.
 * Saves Head & Footer Code entry to the database as custom fields.
 * Outputs code to the website in `wp_head()` and `wp_footer()`.

## Meta

 *  Version **2.4**
 *  Last updated **2 semanas ago**
 *  Active installations **20.000+**
 *  WordPress version ** 3.0.1 or higher **
 *  Tested up to **6.9.4**
 *  Language
 * [English (US)](https://wordpress.org/plugins/addfunc-head-footer-code/)
 * Tags
 * [add to head](https://pe.wordpress.org/plugins/tags/add-to-head/)[footer code](https://pe.wordpress.org/plugins/tags/footer-code/)
   [head code](https://pe.wordpress.org/plugins/tags/head-code/)[per page](https://pe.wordpress.org/plugins/tags/per-page/)
   [tracking code](https://pe.wordpress.org/plugins/tags/tracking-code/)
 *  [Advanced View](https://pe.wordpress.org/plugins/addfunc-head-footer-code/advanced/)

## Ratings

 5 out of 5 stars.

 *  [  25 5-star reviews     ](https://wordpress.org/support/plugin/addfunc-head-footer-code/reviews/?filter=5)
 *  [  0 4-star reviews     ](https://wordpress.org/support/plugin/addfunc-head-footer-code/reviews/?filter=4)
 *  [  0 3-star reviews     ](https://wordpress.org/support/plugin/addfunc-head-footer-code/reviews/?filter=3)
 *  [  0 2-star reviews     ](https://wordpress.org/support/plugin/addfunc-head-footer-code/reviews/?filter=2)
 *  [  0 1-star reviews     ](https://wordpress.org/support/plugin/addfunc-head-footer-code/reviews/?filter=1)

[Your review](https://wordpress.org/support/plugin/addfunc-head-footer-code/reviews/#new-post)

[See all reviews](https://wordpress.org/support/plugin/addfunc-head-footer-code/reviews/)

## Contributors

 *   [ AddFunc ](https://profiles.wordpress.org/addfunc/)
 *   [ Joe Rhoney ](https://profiles.wordpress.org/joerhoney/)

## Support

Issues resolved in last two months:

     0 out of 1

 [View support forum](https://wordpress.org/support/plugin/addfunc-head-footer-code/)

## Donate

Would you like to support the advancement of this plugin?

 [ Donate to this plugin ](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=7AF7P3TFKQ2C2)