# mageplaza/module-google-recaptcha

> Magento 2 Google Recaptcha Extension

`composer require mageplaza/module-google-recaptcha`

Canonical URL: https://packagento.com/mageplaza/module-google-recaptcha

## At a glance

- **Vendor**: mageplaza (https://packagento.com/mageplaza.md)
- **Latest version**: 4.0.5 — released 2025-09-29
- **Pricing**: Free
- **Package type**: Magento 2 module
- **Status**: active, accepting new buyers

## Installation

Packagento is licence-gated, so even free packages need a licence on a project before Composer can resolve them.

1. **Sign in or create an account** at https://packagento.com/customer/account/.

2. **Add the package to your account.** Open https://packagento.com/mageplaza/module-google-recaptcha and complete the free checkout. A licence is minted automatically.

3. **Create or pick a project, then activate the licence on it.**
   - Projects represent the Magento installs you deploy to. Manage them at https://packagento.com/projects/.
   - Activate the new licence on the project you'll deploy this package to. Activation is what generates the Composer credentials scoped to that project.

4. **Add the project credentials to your Magento codebase.**

   Grab the project's public + private key from https://packagento.com/projects/ (open the project, then its Credentials tab), and add them to `auth.json`:

   ```json
   {
     "http-basic": {
       "packagento.com": {
         "username": "ppk_live_...",
         "password": "psk_live_..."
       }
     }
   }
   ```

   Add the Packagento Composer repository to `composer.json`:

   ```json
   {
     "repositories": [
       { "type": "composer", "url": "https://packagento.com" }
     ]
   }
   ```

5. **Install and apply.**

   ```bash
   composer require mageplaza/module-google-recaptcha:*
   bin/magento setup:upgrade
   bin/magento setup:di:compile
   bin/magento cache:flush
   ```

## What it does

Magento 2 Google Recaptcha Extension

## README


**Magento 2 Google reCAPTCHA** keeps abusive activities away. By creating a human-friendly shield, bots will be not allowed to access your admin panel and your store, while humans can pass through with ease.

[![Latest Stable Version](https://poser.pugx.org/mageplaza/module-google-recaptcha/v/stable)](https://packagist.org/packages/mageplaza/module-google-recaptcha)
[![Total Downloads](https://poser.pugx.org/mageplaza/module-google-recaptcha/downloads)](https://packagist.org/packages/mageplaza/module-google-recaptcha)


* Add **Invisible CAPTCHA** to all forms on the frontend
* Add **Visible CAPTCHA** to **the backend** *(Featured)*
* Works on **any kinds of forms** *(Featured)*
* Compatible with [Mageplaza extensions](https://www.mageplaza.com/magento-2-extensions/)

![google recaptcha](https://i.imgur.com/bmMVYO3.gif)

**IMPORTANT NOTE:** This version of Mageplaza Google reCAPTCHA extension on Github is free as a contribution to the Magento community from Mageplaza. This package does not include the technical support. Should you need technical support for this extension, you will have to buy a license from Mageplaza. [Click here to buy](https://www.mageplaza.com/magento-2-google-recaptcha/).

### 1. Documentation

- [Installation guide](https://www.mageplaza.com/install-magento-2-extension/)
- [User guide](https://docs.mageplaza.com/google-recaptcha/index.html)
- [Introduction page](http://www.mageplaza.com/magento-2-google-recaptcha/)
- [Contribute on Github](https://github.com/mageplaza/magento-2-google-recaptcha)
- [Get Support](https://github.com/mageplaza/magento-2-google-recaptcha/issues)

### 2. FAQs

**Q: I got error: Mageplaza_Core has been already defined**

A: Read solution [here](https://github.com/mageplaza/module-core/issues/3)

**Q: What types of forms that Google reCAPTCHA can be displayed on?**

A: There are 6 forms which can be selected to display reCAPTCHA on frontend: Login, Forget password, Change password, Product review, Contact us and Registration form. However, admins can insert URL paths and CSS selectors to display reCAPTCHA on any forms they want.

**Q: What types of CAPTCHA that your module is applying?**

A: reCAPTCHA v2 and invisible CAPTCHA are integrated in Magento 2 Google reCAPTCHA.

**Q: Where in a form can I display reCAPTCHA?**

A: You can display reCAPTCHA on the Bottom left, Bottom right and Inline.

**Q: Can I change the language of reCAPTCHA?**

A: Yes, you can choose a language code to display reCAPTCHA on the backend.

### 3. How to install Magento 2 Google reCAPTCHA extension

Run the following command in Magento 2 root folder:

With Marketing Automation (recommend):

```
composer require mageplaza/module-google-recaptcha mageplaza/module-smtp
php bin/magento setup:upgrade
php bin/magento setup:static-content:deploy
```

Without Marketing Automation:
```
composer require mageplaza/module-google-recaptcha
php bin/magento setup:upgrade
php bin/magento setup:static-content:deploy
```

### 4. Google reCAPTCHA highlight features

#### Invisible reCAPTCHA

**Mageplaza Google reCAPTCHA extension** integrates **invisible reCAPTCHA** which allows humans to pass through the protection with ease, yet it stops bots from abusive activities.

There is no CAPTCHA box within the form’s area, invisible CAPTCHA appears on the right/left bottom of the page which ensures not to distract the user. Invisible CAPTCHA will only popped up if any abusive activities from bots are found, and let humans go through without any interruption.

#### Add Google reCAPTCHAs to any forms

There’s no limit to add reCAPTCHAs to any kinds of form on the frontend. Admins can either select available forms or insert URL paths/CSS selectors to display reCAPTCHAs to anywhere they want. There are 6 forms which are available to select with ease:

* Login form
* Registration form
* Forgot password form
* Contact us
* Change password
* Product review

#### Backend reCAPTCHAs

**Magento 2 Google reCAPTCHA** also allows **adding CAPTCHA to the backend** in two forms:

* Admin Login
* Admin Forgot Password

![backend captchas](https://i.imgur.com/0ZTFv2i.png)

### 5. More features

#### Customize reCaptcha forms

Set no limit to which forms to display **Google reCAPTCHA** by inserting URL post paths and CSS selectors.

#### Compatibility
**Google reCaptcha for Magento 2** is highly compatible with other extensions: Mageplaza Blog, Mageplaza Security, Mageplaza Social Login, Mageplaza Gift Card, Mageplaza One Step Checkout.

#### Badge positions
**Google reCAPTCHAs** can be displayed right in the form or on the bottom left or on the bottom right of the page

#### Multi-language CAPTCHAs
Add a language code to change the language of reCAPTCHAs.

### 6. Full Magento 2 Google ReCaptcha feature list

#### For admins
* Turn on/off module
* Change reCAPTCHAs’ language
* Invisible reCAPTCHAs are added to all forms on the frontend
* Visible CAPTCHAs are added to the backend
* CAPTCHA is added to the admin login form
* CAPTCHA is added to the admin’s forgot-password form
* Turn on/off reCAPTCHAs on the frontend
* Be able to add CAPTCHAs to all kinds of forms on the frontend
* Be able to add CAPTCHAs at 3 positions: inline, right bottom and left bottom
* Be able to select themes and sizes for CAPTCHAs
* Compatible with Mageplaza extensions: Blog, Security, Social Login, Gift Card, One Step Checkout. 

#### For users

* Invisible CAPTCHAs: users are not disrupted by visible reCAPTCHAs. Humans pass through easily while bots are not allowed to access.

### 7. How to configure Google Recaptcha extension

![How to configure Google Recaptcha extension](https://i.imgur.com/XhPOWBt.png)

#### Configuration

##### General configuration

![general configuration](https://i.imgur.com/uZV1gjS.png)

* **Enable**: Choose Yes to turn the module on
* **Language Code** : Selec

_(README truncated for .md surface. Full README on https://packagento.com/mageplaza/module-google-recaptcha.)_

## Changelog

CHANGELOG: https://www.mageplaza.com/releases/google-recaptcha

## Recent Versions

| Version | Released |
|---|---|
| 4.0.5 | 2025-09-29 |
| 4.0.4 | 2023-06-28 |
| 4.0.3 | 2023-04-18 |
| 1.2.3 | 2021-08-22 |
| 4.0.2 | 2021-08-22 |
| 4.0.1 | 2021-06-06 |
| 4.0.0 | 2020-10-01 |
| 1.2.2 | 2020-07-08 |
| 1.2.1 | 2020-05-06 |
| 1.2.0 | 2020-04-29 |

Showing 10 of 17 versions. Full release history on https://packagento.com/mageplaza/module-google-recaptcha.

## Dependencies

### Require

| Package | Constraint |
|---|---|
| google/recaptcha | ^1.2 |
| mageplaza/module-core | ^1.5.14 |

## Quality

Latest release (4.0.5) fails the Packagento QA pipeline. Verdicts below are per-cell (Magento line × PHP version) for the matrixed tools, and run-once for the static / security tiers.


### Compatibility

Each Magento line is installed on its supported PHP versions, then the module is built (DI compile + static-content deploy). Cells show passed / failed / untested; staircase gaps render as `–`.

| Magento | PHP 8.2 | PHP 8.3 | PHP 8.4 | PHP 8.5 |
|---|---|---|---|---|
| 2.4.7 | Pass | Pass | – | – |
| 2.4.8 | – | Pass | Pass | – |
| 2.4.9 | – | – | 1 | 1 |


### Code Quality

Advisory checks against the module's source. Never affect the Compatibility verdict — a phpcs finding can't make a module incompatible.

#### Static Analysis

Coding standards (phpcs), mess detection (phpmd), copy-pasted code (cpd), PHP cross-version compatibility, composer.json validity. Each runs once for the whole module.

| Tool | Status | Findings | Summary |
|---|---|---|---|
| PHPCS | Fail | 59 | 4 errors, 55 warnings (ruleset: Magento2) — 29 auto-fixable with phpcbf |
| PHPMD | Warning | 17 | 17 rule violations (UndefinedVariable:8, UnusedFormalParameter:5, CyclomaticComplexity:2, NPathComplexity:1, UnusedLocalVariable:1) |
| Cpd | Pass | 0 |  |
| Composer validate | Info | 1 | valid; 1 advisory note (composer validate --strict) |

#### PHPStan

Type-checks the module against a real Magento install. Re-runs per Magento + PHP version because resolvable symbols differ between releases.

| Magento | PHP 8.2 | PHP 8.3 | PHP 8.4 | PHP 8.5 |
|---|---|---|---|---|
| 2.4.7 | 58 | 58 | – | – |
| 2.4.8 | – | 58 | 58 | – |
| 2.4.9 | – | – | 56 | 56 |


### Tests

Unit and integration suites run per Magento + PHP cell. Test failures speak to the module's behaviour, not its compatibility with a line, so they're reported here separately.

#### Unit Tests

| Magento | PHP 8.2 | PHP 8.3 | PHP 8.4 | PHP 8.5 |
|---|---|---|---|---|
| 2.4.7 | N/A | N/A | – | – |
| 2.4.8 | – | N/A | N/A | – |
| 2.4.9 | – | – | N/A | N/A |

#### Integration Tests

| Magento | PHP 8.2 | PHP 8.3 | PHP 8.4 | PHP 8.5 |
|---|---|---|---|---|
| 2.4.7 | N/A | N/A | – | – |
| 2.4.8 | – | N/A | N/A | – |
| 2.4.9 | – | – | N/A | N/A |


### Security

Dependency-advisory audit (composer audit) plus a source malware scan. A malware detection fails the version outright.

| Tool | Status | Findings | Summary |
|---|---|---|---|
| Composer audit | Pass | 0 |  |
| Malware scan | Pass | 0 |  |

## Licence and pricing

Free. A licence is still minted on checkout and bound to your project for Composer access — no payment step.

Refundable within 14 days of first purchase via https://packagento.com/account/refunds/.

## Install via Claude Code or any MCP client

The Packagento MCP server can run the licence + project + Composer steps above in one tool call:

```
purchase_and_install_packages(
  composer_names=["mageplaza/module-google-recaptcha"],
  project_id="proj_xxx"
)
```

This handles cart, checkout, licence minting, project activation, and writes auth.json credentials. Connect a client with `claude mcp add packagento https://mcp.packagento.com`. Full setup at https://packagento.com/docs/mcp-setup.

## Vendor

mageplaza is a Magento 2 vendor on Packagento. See https://packagento.com/mageplaza.md for their full catalogue.

