Title: Why use wp_enqueue_script()?
Last modified: August 19, 2016

---

# Why use wp_enqueue_script()?

 *  [discern](https://wordpress.org/support/users/discern/)
 * (@discern)
 * [16 years, 2 months ago](https://wordpress.org/support/topic/why-use-wp_enqueue_script/)
 * Can anyone offer a good reason to use wp_enqueue_script()? If I control the theme’s
   header, footer and other PHP scripts (and I don’t call this function), why wouldn’t
   I use script tags directly? Is there ever a situation where WordPress would throw
   in another script tag to, say, jQuery?
 * I realize there are a lot of scripts included in the wp-includes directory, but
   it would seem I have less control of which version is called if I use wp_enqueue_script().
   I understand using it in a plugin, but a theme?
 * I’m open to it, but I guess I just don’t see a clear rationale behind using it
   in a WordPress _theme_.

Viewing 1 replies (of 1 total)

 *  [ancawonka](https://wordpress.org/support/users/ancawonka/)
 * (@ancawonka)
 * [16 years, 2 months ago](https://wordpress.org/support/topic/why-use-wp_enqueue_script/#post-1412235)
 * Hi there,
 * I’m learning about this as well, and here’s what I understand…
 * Plugins can load additional scripts, which might conflict with what you’re adding
   in your theme.
 * Check out the discussion on this post:
 * [http://digwp.com/2009/06/including-jquery-in-wordpress-the-right-way/](http://digwp.com/2009/06/including-jquery-in-wordpress-the-right-way/)
 * It pertains to JQuery, but I think it applies to other scripts as well.

Viewing 1 replies (of 1 total)

The topic ‘Why use wp_enqueue_script()?’ is closed to new replies.

## Tags

 * [javascript](https://wordpress.org/support/topic-tag/javascript/)
 * [script](https://wordpress.org/support/topic-tag/script/)
 * [wp_enqueue_script](https://wordpress.org/support/topic-tag/wp_enqueue_script/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 2 participants
 * Last reply from: [ancawonka](https://wordpress.org/support/users/ancawonka/)
 * Last activity: [16 years, 2 months ago](https://wordpress.org/support/topic/why-use-wp_enqueue_script/#post-1412235)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
