Title: exclude admin_head from certain admin pages?
Last modified: August 18, 2016

---

# exclude admin_head from certain admin pages?

 *  [harknell](https://wordpress.org/support/users/harknell/)
 * (@harknell)
 * [18 years, 11 months ago](https://wordpress.org/support/topic/exclude-admin_head-from-certain-admin-pages/)
 * I have a plugin that needs some javascript to appear in the head of my plugins
   admin page. It turns out though that the javascript I need conflicts with the
   usage of the sidebar widgets plugin admin page needed for version of wordpress
   previous to 2.2 (the 2.2 version of widgets doesn’t have a problem with my javascript).
   I put the javascript into the admin head by using admin_head as the hook, but
   I can’t figure out a way to do a conditional statement to limit the javascript
   to only appearing if the page is my plugin admin page and not any/every admin
   page. I know in 2.1 they added a new function to do this, but I want to have 
   the plugin be compatible with 2.0 also, so I’m trying to figure out a way to 
   do this.
 * Any ideas? Maybe a different way to add the javascript?

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [whooami](https://wordpress.org/support/users/whooami/)
 * (@whooami)
 * [18 years, 11 months ago](https://wordpress.org/support/topic/exclude-admin_head-from-certain-admin-pages/#post-585315)
 * _the javascript to only appearing if the page is my plugin admin page and not
   any/every admin page. _
 * since you dont always have to have script calls within `<head>` tags, why not
   just add the code specifically to the options page you are creating for the plugin..
 * Follow?
 *  Thread Starter [harknell](https://wordpress.org/support/users/harknell/)
 * (@harknell)
 * [18 years, 11 months ago](https://wordpress.org/support/topic/exclude-admin_head-from-certain-admin-pages/#post-585371)
 * Duh, apparently I’m not Mr. Javascript. I didn’t realize that you could do that.
   Once I moved it to the actual page it worked fine. Thanks for the tip.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘exclude admin_head from certain admin pages?’ is closed to new replies.

 * 2 replies
 * 2 participants
 * Last reply from: [harknell](https://wordpress.org/support/users/harknell/)
 * Last activity: [18 years, 11 months ago](https://wordpress.org/support/topic/exclude-admin_head-from-certain-admin-pages/#post-585371)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
