Title: Remove api.js?
Last modified: August 30, 2016

---

# Remove api.js?

 *  Resolved [flynsarmy](https://wordpress.org/support/users/flynsarmy/)
 * (@flynsarmy)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/remove-apijs/)
 * I only use BWP-Recaptcha on my contact form (which is on a single page) however
   the plugin loads api.js (which in turn loads more JS files) and don’t want to
   load the JS on any other pages than my contact page. I’m wondering how I can 
   remove the `wp_footer` action hook you use?
 * It’s added with
 *     ```
       add_action('wp_footer', array($this, 'printRecaptchaJS'), $priority);
       ```
   
 * so I tried
 *     ```
       global $bwp_capt;
       remove_action('wp_footer', [$bwp_capt->get_captcha_provider(), 'printRecaptchaJS'], 100000);
       ```
   
 * but that didn’t work. Could you perhaps add some way to easily remove (or not
   load in the first place) the JS in a future version if this is not possible?
 * [https://wordpress.org/plugins/bwp-recaptcha/](https://wordpress.org/plugins/bwp-recaptcha/)

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

 *  Plugin Author [Khang Minh](https://wordpress.org/support/users/oddoneout/)
 * (@oddoneout)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/remove-apijs/#post-6609822)
 * You’re almost there, use this instead:
 *     ```
       global $bwp_capt;
       remove_action('wp_footer', [$bwp_capt->get_captcha_provider(), 'printRecaptchaJS'], 9);
       ```
   
 * Notice the **9** priority.
 * You can put this in your theme’s functions.php file, but only remove the action
   for non-contact pages (you can use `is_page()` to do that).
 *  Thread Starter [flynsarmy](https://wordpress.org/support/users/flynsarmy/)
 * (@flynsarmy)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/remove-apijs/#post-6609825)
 * That didn’t do the trick. I had already attempted both a lower and higher priority.
 *  Plugin Author [Khang Minh](https://wordpress.org/support/users/oddoneout/)
 * (@oddoneout)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/remove-apijs/#post-6609834)
 * Opps sorry, can you try 99999? It must be exactly the same priority. Can I see
   the whole codes and which file did you put them into?
 *  Thread Starter [flynsarmy](https://wordpress.org/support/users/flynsarmy/)
 * (@flynsarmy)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/remove-apijs/#post-6609836)
 * Priority 99999 did the trick. Thanks!
 *  [dbrabyn](https://wordpress.org/support/users/dbrabyn/)
 * (@dbrabyn)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/remove-apijs/#post-6610045)
 * Not working for me inside an _is\_front\_page_ conditional statement.
 * [https://www.gstatic.com/recaptcha/api2/r20160208154954/recaptcha__en.js](https://www.gstatic.com/recaptcha/api2/r20160208154954/recaptcha__en.js)
   is loading which it shouldn’t do anyway (no form of any kind).
 * Any help much appreciated.
 *  Plugin Author [Khang Minh](https://wordpress.org/support/users/oddoneout/)
 * (@oddoneout)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/remove-apijs/#post-6610046)
 * [@dbrabyn](https://wordpress.org/support/users/dbrabyn/) you can try using [https://codex.wordpress.org/Plugin_API/Action_Reference/template_redirect](https://codex.wordpress.org/Plugin_API/Action_Reference/template_redirect)
   action hook to add the needed conditional statements.
 *  [dbrabyn](https://wordpress.org/support/users/dbrabyn/)
 * (@dbrabyn)
 * [9 years, 10 months ago](https://wordpress.org/support/topic/remove-apijs/#post-6610052)
 * Would you mind spelling out the snippet?

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

The topic ‘Remove api.js?’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/bwp-recaptcha.svg)
 * [Better WordPress reCAPTCHA (with no CAPTCHA reCAPTCHA)](https://wordpress.org/plugins/bwp-recaptcha/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/bwp-recaptcha/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/bwp-recaptcha/)
 * [Active Topics](https://wordpress.org/support/plugin/bwp-recaptcha/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/bwp-recaptcha/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/bwp-recaptcha/reviews/)

 * 7 replies
 * 3 participants
 * Last reply from: [dbrabyn](https://wordpress.org/support/users/dbrabyn/)
 * Last activity: [9 years, 10 months ago](https://wordpress.org/support/topic/remove-apijs/#post-6610052)
 * Status: resolved