Title: remove javascript from header!
Last modified: August 19, 2016

---

# remove javascript from header!

 *  [isaidicanshout](https://wordpress.org/support/users/isaidicanshout/)
 * (@isaidicanshout)
 * [15 years, 9 months ago](https://wordpress.org/support/topic/remove-javascript-from-header/)
 * [http://isaidicanshout.com/v2/](http://isaidicanshout.com/v2/)
 * on this page i have a TON of javascript code doing various things: hiding elements;
   sliding divs; jquery masonry; image galleries; etc.
 * is there a way to move all of this javascript somewhere else? to an external .
   js file for example? it makes the code look awfully messy.
 * thanks!!

Viewing 1 replies (of 1 total)

 *  [David Gwyer](https://wordpress.org/support/users/dgwyer/)
 * (@dgwyer)
 * [15 years, 9 months ago](https://wordpress.org/support/topic/remove-javascript-from-header/#post-1673867)
 * The best way really is to put all your javascript into separate file(s) and the
   reference them from say, your header.php file, by enqueuing them. See here for
   all the relevant details:
 * [http://codex.wordpress.org/Function_Reference/wp_enqueue_script](http://codex.wordpress.org/Function_Reference/wp_enqueue_script)
 * This is the standard way to reference/load external js files to make sure they
   are added properly.

Viewing 1 replies (of 1 total)

The topic ‘remove javascript from header!’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 2 participants
 * Last reply from: [David Gwyer](https://wordpress.org/support/users/dgwyer/)
 * Last activity: [15 years, 9 months ago](https://wordpress.org/support/topic/remove-javascript-from-header/#post-1673867)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
