[resolved] How to: Remove recaptcha CSS from header. (5 posts)

  1. Hayden James
    Posted 4 years ago #

    If like me page load performance is very important you can remove the CSS from the header.

    Wp-recaptcha adds this to EVERY PAGE!!!:
    <link rel="stylesheet" type="text/css" href="http://coolvibe.com/wp-content/plugins/wp-recaptcha/recaptcha.css" />

    I ONLY use wp-recaptcha for new registrations. So CSS on every blog page was just pointless!

    I removed by changing this:

    [Code moderated as per the Forum Rules. Please use the pastebin]

  2. Lisa Mid
    Posted 4 years ago #

    Copy everything from /wp-content/plugins/wp-recaptcha/wp-recaptcha.css into your themes main stylesheet.

    Open /wp-content/plugins/wp-recaptcha/wp-recaptcha.php

    Find function re_css() {

    Change the whole function to look like this:

    function re_css() {
    	return true;
       global $recaptcha_opt, $wpmu;
       if (!defined('WP_CONTENT_URL'))
          define('WP_CONTENT_URL', '/wp-content');
       $path = WP_CONTENT_URL . '/plugins/wp-recaptcha/recaptcha.css';
       if ($wpmu == 1)
    		$path = WP_CONTENT_URL . '/mu-plugins/wp-recaptcha/recaptcha.css';
       echo '<link rel="stylesheet" type="text/css" href="' . $path . '" />';


    We just changed it in our blog and found your question http://pr11.de

  3. Hayden James
    Posted 4 years ago #

    Same issue after latest update. How do you resolve? The above post is no longer a valid fix.

  4. Hayden James
    Posted 4 years ago #


  5. Hayden James
    Posted 4 years ago #


    add_action('wp_head', array(&$this, 'register_stylesheets')); // make unnecessary: instead, inform of classes for styling

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic