Title: Better Performance: Remove Javascript / CSS if not needed
Last modified: November 4, 2023

---

# Better Performance: Remove Javascript / CSS if not needed

 *  Resolved [tbauerdigital](https://wordpress.org/support/users/tbauerdigital/)
 * (@tbauerdigital)
 * [2 years, 6 months ago](https://wordpress.org/support/topic/better-performance-remove-javascript-css-if-not-needed/)
 * I love the simple yet powerful functionality that the Email Encoder plugin offers.
   I currently only use the “simple HTML character encoding” function on many websites.
   In this case, it is not necessary to load jQuery and the additional script/CSS
   from Email Encoder. From my point of view, it would be ideal if you could deactivate
   these scripts in the config. Would that be possible?

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

 *  Thread Starter [tbauerdigital](https://wordpress.org/support/users/tbauerdigital/)
 * (@tbauerdigital)
 * [2 years, 6 months ago](https://wordpress.org/support/topic/better-performance-remove-javascript-css-if-not-needed/#post-17220755)
 * Since there seems to be no solution here, I have added a small function to function.
   php. This allows you to avoid loading the two assets (script and CSS) and thus
   also jquery.js.
 * Here is the script (insert in Theme > functions.php):
 *     ```wp-block-code
       // disable Email Encoder style/js
       function tba_disable_scripts_styles() {
       	wp_dequeue_style('eeb-css-frontend');
       	wp_dequeue_script('eeb-js-frontend');
       }
       add_action('wp_enqueue_scripts', 'tba_disable_scripts_styles', 100);
       ```
   
 *  [hj](https://wordpress.org/support/users/hj/)
 * (@hj)
 * [2 years, 5 months ago](https://wordpress.org/support/topic/better-performance-remove-javascript-css-if-not-needed/#post-17247311)
 * Thanks for that useful script, tbauer – a very simple way to disable what should
   be configurable in the plugin admin.
 *  [Ironikus](https://wordpress.org/support/users/ironikus/)
 * (@ironikus)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/better-performance-remove-javascript-css-if-not-needed/#post-17334417)
 * Hey [@tbauerdigital](https://wordpress.org/support/users/tbauerdigital/) – I’ve
   implemented additional logic to optimize the enqueue of our scripts and styles.
   It’s going to be available with version 2.2.0
 *  Thread Starter [tbauerdigital](https://wordpress.org/support/users/tbauerdigital/)
 * (@tbauerdigital)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/better-performance-remove-javascript-css-if-not-needed/#post-17339215)
 * [@ironikus](https://wordpress.org/support/users/ironikus/) perfect, thanks a 
   lot for this and your great work. Wish you a nice day.

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

The topic ‘Better Performance: Remove Javascript / CSS if not needed’ is closed 
to new replies.

 * ![](https://ps.w.org/email-encoder-bundle/assets/icon-256x256.png?rev=2056506)
 * [Email Encoder - Protect Email Addresses and Phone Numbers](https://wordpress.org/plugins/email-encoder-bundle/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/email-encoder-bundle/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/email-encoder-bundle/)
 * [Active Topics](https://wordpress.org/support/plugin/email-encoder-bundle/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/email-encoder-bundle/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/email-encoder-bundle/reviews/)

## Tags

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

 * 5 replies
 * 3 participants
 * Last reply from: [tbauerdigital](https://wordpress.org/support/users/tbauerdigital/)
 * Last activity: [2 years, 4 months ago](https://wordpress.org/support/topic/better-performance-remove-javascript-css-if-not-needed/#post-17339215)
 * Status: resolved