Skip to content
  • Pricing
  • Products & Services
      Save 25%

      Solid Suite

      Secure your sites, keep them safely backed up, and grow your business… all while saving time and money.

      • Solid Security
      • Solid Backups
      • Solid Central
      • Solid Academy
      See pricing

      Protect

      Shield your site from cyberattacks and prevent security vulnerabilities

      A cloud-first solution for rocket fast backups and one-click restore.

      Repair

      Hacked website? Let our WordPress security experts clean up malicious code, remove threats and restore your site.

      Manage

      Maximize and amplify your admin with remote multi-site management.

      Ensure delivery of every email sent from your site.

      Free Plugins

  • Resources
      Save 25%

      Solid Suite

      Secure your sites, keep them safely backed up, and grow your business… all while saving time and money.

      • Solid Security
      • Solid Backups
      • Solid Central
      • Solid Academy
      See pricing

      Academy

      Solid Academy

      For anyone who wants to start or grow a business around WordPress.

      Guides

      Dive deeper into our free WordPress and business guides.

      Livestreams

      Free livestreams to help you discover new tools and work more efficiently

      Tutorials Academy

      Learn WordPress with our beginner WordPress tutorials

      Resources

      Blog

      Catch up on the latest news from our WordPress security experts

      Vulnerability Report

      Keep track of every new plugin and theme vulnerability

      Support

      Your success with Security, Backups and Central is our highest priority.

      Documentation

      Learn everything you need to know about our products & services.

Sign In Get Solid Suite
SolidWP Logo Black
  • Pricing
  • Products & Services
    • Solid Security Pro
    • Solid Backups — NextGen
    • Solid Fix
    • Solid Central
    • Free Plugins
    • Solid Security
    • Solid Performance
    • Solid Mail
  • Resources
    • Solid Academy
    • Guides
    • Livestreams
    • Tutorials
    • Blog
    • Vulnerability Report
    • Support
    • Documentation

How It Works

17
  • All About Solid Security’s Tools
  • Using Solid Security’s CAPTCHA
  • All about Firewall with Solid Security
  • Solid Security Two-Factor Authentication (2FA) Settings Guide
  • Releasing Site Lockouts in Solid Security
  • Diagnosis Tips: Raw Details of Site Scanner Logs
  • SolidWP Licensing: How to Make sure your site is licensed correctly
  • All about Solid Security’s Debug Mode
  • Frequently Asked Questions
  • Vulnerability Protection with Solid Security
  • Security Logs
  • All about User Security with Solid Security
  • All about Solid Security Site Scans
  • Solid Security Dashboard
  • What are Passkeys for WordPress Websites?
  • All about the Solid Security Settings
  • Understanding Trusted Devices in Solid Security

Learn More

9
  • Restrict Admin Access by Country Settings Guide
  • Security Headers Settings Guide
  • List of Solid Security Pro Action Hooks
  • How Do I Integrate My Plugin with Solid Security Pro reCAPTCHA?
  • Solid Security Pro WP-CLI Integration
  • All about Solid Security’s Debug Mode
  • Frequently Asked Questions
  • What are Passkeys for WordPress Websites?
  • Understanding Trusted Devices in Solid Security
View Categories
  • Home
  • SolidWP Documentation
  • Solid Security
  • Learn More
  • How Do I Integrate My Plugin with Solid Security Pro reCAPTCHA?

How Do I Integrate My Plugin with Solid Security Pro reCAPTCHA?

3 min read

Integrating your plugin with Solid Security’s CAPTCHA – reCAPTCHA feature is a simple process. In this article, we cover how to display and validate the reCAPTCHA.

Solid Security fires the itsec_recaptcha_api_ready hook when it is time for plugins to set up their Recaptcha integrations. At this point, Solid Security has already verified that the site administrator has configured their access tokens. You can also check if the API is available by calling ITSEC_Recaptcha_API::is_available().

Technical Details: This happens during WordPress’ init hook on the standard 10 priority.

Displaying the reCAPTCHA #

To display the reCAPTCHA, simply call the ITSEC_Recaptcha_API::display() function. If the API is not available, an empty string will be displayed.

You don’t need to worry about fetching API keys or choosing whether to display reCAPTCHA V2 or Invisible reCAPTCHA, Solid Security handles all of that.

For example:

function my_plugin_display_recaptcha() {
	ITSEC_Recaptcha_API::display();
}
add_action( 'my_login_form_template', 'my_plugin_display_recaptcha' );

Technical Details: The Recaptcha field requires JavaScript to work properly. The show_recaptcha() method will automatically enqueue the necessary scripts. If you are loading your form via Ajax, you might need to manually print these scripts. Call wp_print_scripts() aftercalling the show_recaptcha() method.

By default, the V2 reCAPTCHA badge has 10 pixels of margin on the top and bottom. You can customize this by using the margin option.

For example:

ITSEC_Recaptcha_API::display( array( 'margin' => array( 'top' => '20' ) ) );

This will change the top margin to 20 pixels and leave the rest of the margins as their default values. You can completely disable the margin by passing null to the option.

Validating the reCAPTCHA #

If your plugin ends up calling the authenticate filter, typically by calling the wp_signon() or wp_authenticate() functions or posting your login form directly to wp-login.php, then Solid Security will automatically pick up that the reCAPTCHA was submitted.

Likewise, for the registration form, if you use the register_new_user() function, Solid Security will work transparently.

Alternatively, if you have a custom login or registration form, or a completely different use case, you can call the validation function directly.

function my_plugin_do_login() {
	$validated = ITSEC_Recaptcha_API::validate();

	if ( is_wp_error( $validated ) ) {
		// Show error message.
		return false;
	}
	// User submitted the Recaptcha. Continue with custom login.
}

This will look in the post variables for g-recaptcha-response. This will work automatically when using Recaptcha in a standard HTML Form context.

If this value won’t be populated when calling the validate() function, when using a GET form, for instance, you should manually set $_POST['g-recaptcha-response'] to the captcha value.

Solid Security does not currently support passing the response code directly to the validate() function.

Technical Details: The validation result is cached for the duration of the request. If Google’s Recaptcha API is temporarily unavailable, Solid Security will treat the validation as successful.

Updated on April 22, 2026

Was this doc helpful?

  • Happy
  • Normal
  • Sad
Solid Security Pro WP-CLI Integration
Table of Contents
  • Displaying the reCAPTCHA
  • Validating the reCAPTCHA
SolidWP
  • Pricing
  • Products
    • Solid Suite – save 25%
    • Solid Security
    • Solid Backups — NextGen
    • Solid Central Pro
  • Resources
    • Blog
    • Academy
    • Guides
    • Tutorials
    • Vulnerability report
  • Support
    • Documentation
  • My account
  • Contact us
    • Terms
    • Refund policy
    • Privacy policy
    • Change Cookie Preferences
  • About SolidWP
    • FAQ
    • Looking for iThemes?
    • Affiliates
    • Press
  • Our Partner Brands
    • GiveWP
    • Iconic
    • KadenceWP
    • LearnDash
    • MemberDash
    • Orderable
    • The Events Calendar

Get Solid Suite bundled with hosting.

Explore StellarSites
  • X
  • YouTube
  • Facebook

A Liquid Web Brand
Hosting for WordPress
© 2025 All Rights Reserved

StellarWP logo
Liquid Web logo