Title: Dequeue Scripts
Last modified: March 2, 2023

---

# Dequeue Scripts

 *  Resolved [aimdoll](https://wordpress.org/support/users/aimdoll/)
 * (@aimdoll)
 * [3 years, 2 months ago](https://wordpress.org/support/topic/dequeue-scripts-3/)
 * Hello,
   I am attempting to improve site performance on the site linked above. 
   With that being said, I want to dequeue/deregister or remove the action that 
   is enqueuing scripts for akismet for logged out users and on certain pages where
   the javascript does not need to be ran. I have tried dequeuing and deregistering
   via the child theme but have not had any success. Can you please tell me how 
   I can do this via dequeuing or removing the action that calls the enqueue function.
   Thanks in advance for any help you might be able to provide on this topic.
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fdequeue-scripts-3%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  Plugin Author [Christopher Finke](https://wordpress.org/support/users/cfinke/)
 * (@cfinke)
 * [3 years, 2 months ago](https://wordpress.org/support/topic/dequeue-scripts-3/#post-16522474)
 * Something like this should work:
 *     ```wp-block-code
       add_action( 'comment_form', 'dequeue_akismet_js', 99 );
   
       function dequeue_akismet_js() {
           wp_dequeue_script( 'akismet-frontend' );
       }
       ```
   
 * But can you tell me more about when the JS is being enqueued when it’s not necessary?
   Maybe we can fix it for everyone in the plugin itself.
 *  Thread Starter [aimdoll](https://wordpress.org/support/users/aimdoll/)
 * (@aimdoll)
 * [3 years, 2 months ago](https://wordpress.org/support/topic/dequeue-scripts-3/#post-16522534)
 * Hello Christopher,
   Thank you so much! I am very impressed by your response time.
   Have a fantastic day!Best Regards,Amy Singleton
 *  Thread Starter [aimdoll](https://wordpress.org/support/users/aimdoll/)
 * (@aimdoll)
 * [3 years, 2 months ago](https://wordpress.org/support/topic/dequeue-scripts-3/#post-16522694)
 * Hello Again,
   I tried the snippet provided in the child theme and via a plugin.
   Unfortunately it does not work. Thoughts?Best Regards,Amy Singleton
    -  This reply was modified 3 years, 2 months ago by [aimdoll](https://wordpress.org/support/users/aimdoll/).
 *  Plugin Author [Christopher Finke](https://wordpress.org/support/users/cfinke/)
 * (@cfinke)
 * [3 years, 2 months ago](https://wordpress.org/support/topic/dequeue-scripts-3/#post-16522824)
 * Try this; as long as it is in your child theme’s `functions.php` file or in another
   plugin, this should ensure that the script is dequeued. The previous snippet 
   might not have worked depending on when it was run in the hook firing sequence.
 *     ```wp-block-code
       add_action( 'init', 'dequeue_akismet_js', 99 );
   
       function dequeue_akismet_js() {
           remove_action( 'comment_form', array( 'Akismet', 'load_form_js' ) );
       } 
       ```
   

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

The topic ‘Dequeue Scripts’ is closed to new replies.

 * ![](https://ps.w.org/akismet/assets/icon-256x256.png?rev=2818463)
 * [Akismet Anti-spam: Spam Protection](https://wordpress.org/plugins/akismet/)
 * [Support Threads](https://wordpress.org/support/plugin/akismet/)
 * [Active Topics](https://wordpress.org/support/plugin/akismet/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/akismet/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/akismet/reviews/)

## Tags

 * [dequeue](https://wordpress.org/support/topic-tag/dequeue/)
 * [deregister](https://wordpress.org/support/topic-tag/deregister/)
 * [remove action](https://wordpress.org/support/topic-tag/remove-action/)

 * 5 replies
 * 2 participants
 * Last reply from: [Christopher Finke](https://wordpress.org/support/users/cfinke/)
 * Last activity: [3 years, 2 months ago](https://wordpress.org/support/topic/dequeue-scripts-3/#post-16522824)
 * Status: resolved