Title: Add Code To Head
Author: salubrio
Published: <strong>September 23, 2012</strong>
Last modified: March 26, 2025

---

Search plugins

![](https://ps.w.org/add-code-to-head/assets/icon.svg?rev=1263627)

# Add Code To Head

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

[Download](https://downloads.wordpress.org/plugin/add-code-to-head.1.17.zip)

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

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

## Description

Intended users: Template Designers, Developer

If you wish to add any custom HTML to the bottom of each page’s head, then this 
plugin is for you. For example, you can add some custom CSS, a link to an external
javascript file or something else.

The problem with editing the template directly is if you ever update the template,
your changes will be lost. This plugin works around this issue.

### Acknowledgements

Plugin Icon (CC BY 3.0) by [DeniShop](https://www.iconfinder.com/denir)

## Screenshots

 * [[
 * Options screen

## Installation

#### Via your Blog’s install plugin option

 * Click the big ‘Install Plugin’ button in the plugin description window

#### Upload

If you have a single file (ending in “.zip”), then use this method.

 1. From the plugins, add new, click on the **upload** button
 2. Navigate to where the .zip file is located and select it
 3. Make sure to _activate_ the plugin once it is installed

#### Files

If you have multiple files in a directory, use this method.

 1. Upload the entire directory (not just the files) to the `/wp-content/plugins/` 
    directory
 2. Activate the plugin through the ‘Plugins’ menu in WordPress

## FAQ

### Q. Why aren’t my codes being added to the absolute end of the head?

Another plugin or the theme is adding their own codes to the head _after_ this plugin
runs.

### Q. I don’t know HTML/Javascript/CSS; can I still use this plugin?

Yes, but you may easily get confused and mess up your whole site. It is better to
learn the code first before you use this plugin.

### Q. Wordfence says something like “A potentially unsafe operation has been detected in your request to this site.”

If you try to add a script or some other potentially-dangerous code (even if it 
isn’t), Wordfence might complain. Double check your code and if it is okay, mark
it as a false positive in Wordfence.

### Q. Help! I messed up my whole site!

Disable the plugin. If your site is still messed up, then there’s some other problem.

### Q. I disabled your plugin and the problem went away. Now what?

The problem lies in whatever you typed/pasted into this plugin’s option screen. 
If you’re really stuck, then try clearing out the code and starting over.

### Q. Help! I accidentally erased the code and I didn’t mean to do that.

Similar to [how widgets work](https://codex.wordpress.org/WordPress_Widgets), that
data is stored in your database. If you made a backup before you deleted the data,
then you can restore it that way, otherwise it is gone.

### Q. How do I apply code to only a certain page or pages?

Right now you cannot. If there is sufficient demand, then we’ll add it.

### Q. Can I ask for additional functionality?

Absolutely!

## Reviews

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

### 󠀁[Works flawlessly](https://wordpress.org/support/topic/works-flawlessly-81/)󠁿

 [overneathe](https://profiles.wordpress.org/overneathe/) May 22, 2017

Works flawlessly

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

### 󠀁[works perfectly](https://wordpress.org/support/topic/works-perfectly-947/)󠁿

 [neerav](https://profiles.wordpress.org/neerav/) October 22, 2016

used this plugin to add some google code to <head></head>

 [ Read all 2 reviews ](https://wordpress.org/support/plugin/add-code-to-head/reviews/)

## Contributors & Developers

“Add Code To Head” is open source software. The following people have contributed
to this plugin.

Contributors

 *   [ salubrio ](https://profiles.wordpress.org/salubrio/)

[Translate “Add Code To Head” into your language.](https://translate.wordpress.org/projects/wp-plugins/add-code-to-head)

### Interested in development?

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

## Changelog

#### 1.17

 * Tested compatibility up to WP 6.7.1
 * Added note about Wordfence error that might be encountered

#### 1.15

 * Tested compatibility up to WP 5.7.2
 * Reformatted script: converted tabs to spaces

#### 1.13

 * Tested compatibility up to WP 4.6.1

#### 1.11

 * Name changed to (hopefully) reduce confusion.

#### 1.10

 * Screenshot updated
 * Compatibility with latest WordPress

#### 1.09

 * Readme file added

#### 1.07

 * Original release

## Meta

 *  Version **1.17**
 *  Last updated **1 year ago**
 *  Active installations **3,000+**
 *  WordPress version ** 3.3.2 or higher **
 *  Tested up to **6.7.5**
 * Tags
 * [code](https://wordpress.org/plugins/tags/code/)[css](https://wordpress.org/plugins/tags/css/)
   [javascript](https://wordpress.org/plugins/tags/javascript/)[template](https://wordpress.org/plugins/tags/template/)
 *  [Advanced View](https://wordpress.org/plugins/add-code-to-head/advanced/)

## Ratings

 5 out of 5 stars.

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

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

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

## Contributors

 *   [ salubrio ](https://profiles.wordpress.org/salubrio/)

## Support

Got something to say? Need help?

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