Title: Filter wp_head() function
Last modified: August 19, 2016

---

# Filter wp_head() function

 *  Resolved [newboxters](https://wordpress.org/support/users/newboxters/)
 * (@newboxters)
 * [16 years, 8 months ago](https://wordpress.org/support/topic/filter-wp_head-function/)
 * I have 3 plugins (form, chat, poll) that carry a 10 javascripts (ajax) and that
   makes the site very slow.
    However, only use those plugins in 2 pages of my blog.
 * **How to configure function wp_head() to load some plugins on some pages only?**
   
   Example: if you only use the chat plugin page id 12, then only that page loads
   the js, css and all dependent on this plugin, to work.
 * Thank you.

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

 *  [stvwlf](https://wordpress.org/support/users/stvwlf/)
 * (@stvwlf)
 * [16 years, 8 months ago](https://wordpress.org/support/topic/filter-wp_head-function/#post-1236190)
 * Hi
 * See if this article will be helpful
    [http://justintadlock.com/archives/2009/08/06/how-to-disable-scripts-and-styles](http://justintadlock.com/archives/2009/08/06/how-to-disable-scripts-and-styles)
 *  Thread Starter [newboxters](https://wordpress.org/support/users/newboxters/)
 * (@newboxters)
 * [16 years, 7 months ago](https://wordpress.org/support/topic/filter-wp_head-function/#post-1236347)
 * Thank you for the answer, the article is really good, but left me with a question:
   **
   I need to change the plugin files?** I can’t just add a function to display .
   js or .css plugin only on certain pages (ids)?
 * Well if you have to change files for each plugin is bad, because when it updates
   the plugin, my amendment wears off, right?
 *  [stvwlf](https://wordpress.org/support/users/stvwlf/)
 * (@stvwlf)
 * [16 years, 7 months ago](https://wordpress.org/support/topic/filter-wp_head-function/#post-1236349)
 * > because when it updates the plugin, my amendment wears off, right?
 * No, the way the article explains to do it, the amendement does NOT wear off when
   the plugin updates, because you are not modifying the plugin’s code, you are 
   activating WP code from outside the plugin that affects the plugin’s behavior
   without being part of the plugin. Unless the plugin developer later changes the
   name of the files or adds additional files loaded into the head section, you 
   are all set using this method.
 *  Thread Starter [newboxters](https://wordpress.org/support/users/newboxters/)
 * (@newboxters)
 * [16 years, 7 months ago](https://wordpress.org/support/topic/filter-wp_head-function/#post-1236354)
 * You’re right. I just test the method and it worked perfectly.
 * Thank you for referring this great article!

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

The topic ‘Filter wp_head() function’ is closed to new replies.

## Tags

 * [filter](https://wordpress.org/support/topic-tag/filter/)
 * [wp_head](https://wordpress.org/support/topic-tag/wp_head/)

 * 4 replies
 * 2 participants
 * Last reply from: [newboxters](https://wordpress.org/support/users/newboxters/)
 * Last activity: [16 years, 7 months ago](https://wordpress.org/support/topic/filter-wp_head-function/#post-1236354)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
