Title: Remove/Control &#8220;print_inline_styles&#8221;
Last modified: October 29, 2022

---

# Remove/Control “print_inline_styles”

 *  Resolved [bw10](https://wordpress.org/support/users/bw10/)
 * (@bw10)
 * [3 years, 5 months ago](https://wordpress.org/support/topic/remove-control-print_inline_styles/)
 * Hi, I am trying to remove the print_inline_styles() function from my website (
   line 231 in /src/php/main.php).
 * I’ve added the following to my functions.php and nothing seems to work:
 *     ```
       add_action( 'wp_loaded', 'my_plugin_override' );
   
       function my_plugin_override() {
         remove_action( 'wp_head', array( 'HCaptcha', 'print_inline_styles' ) );
       	remove_action( 'wp_head', array( 'HCaptcha', 'print_inline_styles' ), 99 );
       	remove_action( 'wp_head', 'print_inline_styles', 99 );
       }
   
       remove_action( 'wp_head', array( 'HCaptcha', 'print_inline_styles' ) );
       remove_action( 'wp_head', array( 'HCaptcha', 'print_inline_styles' ), 99 );
       remove_action( 'wp_head', array( 'HCaptcha\Main', 'print_inline_styles' ) );
       remove_action( 'wp_head', array( 'HCaptcha\Main', 'print_inline_styles' ), 99 );
       remove_action( 'wp_head', 'print_inline_styles', 99 );
       ```
   
 * I only use it for the login and registration page, so outputting it on every 
   single page is unnecessary.
 * Any guidance you can provide, would be greatly appreciated!

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

 *  Plugin Contributor [kaggdesign](https://wordpress.org/support/users/kaggdesign/)
 * (@kaggdesign)
 * [3 years, 5 months ago](https://wordpress.org/support/topic/remove-control-print_inline_styles/#post-16145490)
 * You should specify not a class name but its instance to make the function work.
   Th following code solves your task:
 * `
 *     ```
       function remove_hcap_print_inline_styles() {
       	if ( ! function_exists( 'hcaptcha' ) ) {
       		return;
       	}
   
       	remove_action( 'wp_head', [ hcaptcha(), 'print_inline_styles' ] );
       }
   
       add_action( 'wp_head', 'remove_hcap_print_inline_styles', 0 );
       ```
   
 *  Thread Starter [bw10](https://wordpress.org/support/users/bw10/)
 * (@bw10)
 * [3 years, 5 months ago](https://wordpress.org/support/topic/remove-control-print_inline_styles/#post-16145581)
 * Thank you so much, that works!

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

The topic ‘Remove/Control “print_inline_styles”’ is closed to new replies.

 * ![](https://ps.w.org/hcaptcha-for-forms-and-more/assets/icon.svg?rev=3026321)
 * [hCaptcha for WP](https://wordpress.org/plugins/hcaptcha-for-forms-and-more/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/hcaptcha-for-forms-and-more/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/hcaptcha-for-forms-and-more/)
 * [Active Topics](https://wordpress.org/support/plugin/hcaptcha-for-forms-and-more/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/hcaptcha-for-forms-and-more/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/hcaptcha-for-forms-and-more/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [bw10](https://wordpress.org/support/users/bw10/)
 * Last activity: [3 years, 5 months ago](https://wordpress.org/support/topic/remove-control-print_inline_styles/#post-16145581)
 * Status: resolved