Title: Remove unused JavaScript
Last modified: May 8, 2021

---

# Remove unused JavaScript

 *  [droyed](https://wordpress.org/support/users/droyed/)
 * (@droyed)
 * [4 years, 11 months ago](https://wordpress.org/support/topic/remove-unused-javascript-6/)
 * Hi [@anlino](https://wordpress.org/support/users/anlino/),
 * How do I remove unused javascript from the theme?

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

 *  Theme Author [Anders Norén](https://wordpress.org/support/users/anlino/)
 * (@anlino)
 * [4 years, 11 months ago](https://wordpress.org/support/topic/remove-unused-javascript-6/#post-14414290)
 * Hi [@droyed](https://wordpress.org/support/users/droyed/),
 * The easiest way (but not all that easy) would probably be to unenqueue the Chaplin
   JavaScript file, and enqueue your own replacement file in a child theme with 
   the code you don’t need stripped out.
 * — Anders
 *  Thread Starter [droyed](https://wordpress.org/support/users/droyed/)
 * (@droyed)
 * [4 years, 11 months ago](https://wordpress.org/support/topic/remove-unused-javascript-6/#post-14414398)
 * Thanks [@anlino](https://wordpress.org/support/users/anlino/)
 * I definitely do not have the technical know-how to do this haha
 * Is there a plugin I could use?
 *  Theme Author [Anders Norén](https://wordpress.org/support/users/anlino/)
 * (@anlino)
 * [4 years, 11 months ago](https://wordpress.org/support/topic/remove-unused-javascript-6/#post-14414410)
 * [@droyed](https://wordpress.org/support/users/droyed/) Yeah, it’s a pretty involved
   thing. A plugin wouldn’t know which JavaScript is needed on which page, so it
   can’t really be automated. You can install a caching plugin to reduce the footprint
   of the JavaScript files overall, but removing JavaScript based on which features
   you’re using would need to be done manually in code.
 *  Thread Starter [droyed](https://wordpress.org/support/users/droyed/)
 * (@droyed)
 * [4 years, 11 months ago](https://wordpress.org/support/topic/remove-unused-javascript-6/#post-14414468)
 * Hi [@anlino](https://wordpress.org/support/users/anlino/)
 * Thank you for your prompt response. I have Google SiteKit plugin that suggested
   the following:
 * [https://prnt.sc/12o2lb8](https://prnt.sc/12o2lb8)
 * [https://prnt.sc/12o2n65](https://prnt.sc/12o2n65)

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

The topic ‘Remove unused JavaScript’ is closed to new replies.

 * ![](https://i0.wp.com/themes.svn.wordpress.org/chaplin/2.6.8/screenshot.png)
 * Chaplin
 * [Support Threads](https://wordpress.org/support/theme/chaplin/)
 * [Active Topics](https://wordpress.org/support/theme/chaplin/active/)
 * [Unresolved Topics](https://wordpress.org/support/theme/chaplin/unresolved/)
 * [Reviews](https://wordpress.org/support/theme/chaplin/reviews/)

## Tags

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

 * 4 replies
 * 2 participants
 * Last reply from: [droyed](https://wordpress.org/support/users/droyed/)
 * Last activity: [4 years, 11 months ago](https://wordpress.org/support/topic/remove-unused-javascript-6/#post-14414468)
 * Status: not resolved