Title: Can&#8217;t dequeue CF7 files
Last modified: September 2, 2020

---

# Can’t dequeue CF7 files

 *  [yopyopyopy](https://wordpress.org/support/users/yopyopyopy/)
 * (@yopyopyopy)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/cant-dequeue-cf7-files/)
 * Hi,
 * as ReCaptcha 3 is breaking my Google Page Speed score, I’m trying to dequeue 
   both Contact Form and ReCaptcha external files from all pages but contact page.
   
   I followed the instructions of this page : [https://contactform7.com/loading-javascript-and-stylesheet-only-when-it-is-necessary/](https://contactform7.com/loading-javascript-and-stylesheet-only-when-it-is-necessary/)
 * But I doesn’t work. Files are still included in my source code :
 * > [https://www.google.com/recaptcha/api.js?render=6LcSosUZAAAAAFR-VBlVWx5MFd9zrhuIgwVD5-vY&ver=3.0](https://www.google.com/recaptcha/api.js?render=6LcSosUZAAAAAFR-VBlVWx5MFd9zrhuIgwVD5-vY&ver=3.0)
   > /
   > wp-content/plugins/contact-form-7/modules/recaptcha/script.js?ver=5.2.2
 * I use WordPress 5.5 and Contact Form 5.2.2
    I don’t use any caching plugin.
 * Here’s my functions.php file :
 *     ```
       function wpdocs_dequeue_script() {
          add_filter( 'wpcf7_load_js', '__return_false' );
          add_filter( 'wpcf7_load_css', '__return_false' );
          wp_dequeue_script('contact-form-7');
          wp_dequeue_style('contact-form-7');
          wp_deregister_script('jquery'); // remove jquery which is manually included in footer.php
       }
       add_action( 'wp_print_scripts', 'wpdocs_dequeue_script', 100 );
       ```
   
 * There lines return a critical error :
 *     ```
          wpcf7_dequeue_scripts();
          wpcf7_dequeue_styles();
       ```
   
    -  This topic was modified 5 years, 9 months ago by [yopyopyopy](https://wordpress.org/support/users/yopyopyopy/).

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

 *  Plugin Author [Takayuki Miyoshi](https://wordpress.org/support/users/takayukister/)
 * (@takayukister)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/cant-dequeue-cf7-files/#post-13349893)
 * FAQ > [reCAPTCHA’s script file is loaded on every page, can I stop it?](https://contactform7.com/faq-about-recaptcha-v3/#stop-script-loading)
 *  Thread Starter [yopyopyopy](https://wordpress.org/support/users/yopyopyopy/)
 * (@yopyopyopy)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/cant-dequeue-cf7-files/#post-13350135)
 * Hi,
 * thank you for your answer but it doesn’t really help me.
    I understand that it’s
   not recommended but the impact of ReCaptcha 3 on my page loading speed is really
   to heavy. I need to dequeue the scripts on all page but contact page.
 * But I don’t understand why the dequeue or filter return false methods doesn’t
   work for me.
 * Please could you help me ?
 * Thanks a lot.
    Best regards, Aurélien
 *  [The-Dude](https://wordpress.org/support/users/the-dude-1/)
 * (@the-dude-1)
 * [5 years, 5 months ago](https://wordpress.org/support/topic/cant-dequeue-cf7-files/#post-13823943)
 * Hi Takayuki,
 * please, many of us need really a solution. We can not accept this decrease of
   loading times.
    Please change the behavior of CF7, so that it only loads on pages
   and post, where it is integrated.
 * Thx a lot 🙂
 *  [Roman from Hella fast](https://wordpress.org/support/users/hellafast/)
 * (@hellafast)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/cant-dequeue-cf7-files/#post-13967165)
 * The code you put above doesn’t specifically dequeue reCaptcha. Try this plugin:
   [https://wordpress.org/plugins/speed-up-contact-form-7/](https://wordpress.org/plugins/speed-up-contact-form-7/)

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

The topic ‘Can’t dequeue CF7 files’ is closed to new replies.

 * ![](https://ps.w.org/contact-form-7/assets/icon.svg?rev=2339255)
 * [Contact Form 7](https://wordpress.org/plugins/contact-form-7/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/contact-form-7/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/contact-form-7/)
 * [Active Topics](https://wordpress.org/support/plugin/contact-form-7/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/contact-form-7/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/contact-form-7/reviews/)

## Tags

 * [reCAPTCHA](https://wordpress.org/support/topic-tag/recaptcha/)

 * 4 replies
 * 4 participants
 * Last reply from: [Roman from Hella fast](https://wordpress.org/support/users/hellafast/)
 * Last activity: [5 years, 4 months ago](https://wordpress.org/support/topic/cant-dequeue-cf7-files/#post-13967165)
 * Status: not resolved