Skip to content

PasanBhanu/contact-form-7-recaptcha-limiter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Contact Form 7 reCAPTCHA Limiter

Contact Form 7 reCAPTCHA Limiter is a WordPress plugin that ensures the reCAPTCHA scripts and styles are loaded only on pages containing Contact Form 7 forms. This improves performance and eliminates unnecessary reCAPTCHA assets on other pages.


Features

  • Limits reCAPTCHA scripts and styles to pages with [contact-form-7] shortcodes.
  • Prevents unnecessary loading of Google reCAPTCHA resources on unrelated pages.
  • Improves site performance by reducing the number of globally loaded scripts.

Requirements

  • WordPress 5.0 or higher
  • Contact Form 7 plugin installed and active
  • PHP 7.0 or higher

Installation

1. Download and Install

  1. Download the plugin files from the repository or your zip archive.
  2. Extract the files and upload the folder contact-form-7-recaptcha-limiter to the /wp-content/plugins/ directory.

2. Activate the Plugin

  1. Go to the Plugins section of your WordPress admin panel.
  2. Find "Contact Form 7 reCAPTCHA Limiter" in the list and click Activate.

Usage

The plugin automatically handles the reCAPTCHA script management. Once activated:

  1. Visit any page with a Contact Form 7 form containing the [contact-form-7] shortcode, and reCAPTCHA will load.
  2. Other pages without the shortcode will not load the reCAPTCHA scripts or styles.

How It Works

  1. The plugin detects pages with the [contact-form-7] shortcode.
  2. It ensures that the google-recaptcha and wpcf7-recaptcha scripts are only enqueued on those pages.
  3. Other pages remain unaffected, improving load time and reducing unnecessary script calls.

FAQ

Why do I need this plugin?

By default, Contact Form 7 loads reCAPTCHA scripts and styles globally on all pages, which can impact site performance. This plugin prevents that and ensures reCAPTCHA is only loaded when required.

Does this plugin modify Contact Form 7?

No, it works as an add-on to Contact Form 7 without modifying its core files.

Will this plugin affect other functionality of Contact Form 7?

No, it only affects the loading behavior of reCAPTCHA scripts and styles. Other functionalities remain intact.

Is this plugin compatible with caching plugins?

Yes, but ensure you clear your cache after activating or deactivating the plugin.


Support

For any issues or feature requests, please open an issue or contact the plugin author.


License

This plugin is licensed under the Apache 2.0 License. See the LICENSE file for more details.


Contribute

Contributions are welcome! If you'd like to contribute:

  1. Fork the repository.
  2. Create a feature branch.
  3. Submit a pull request.

Example Page Setup

Add a Contact Form 7 shortcode to your page content:

[contact-form-7 id="123" title="Contact form 1"]

About

Limit reCaptcha Loading Only to Pages with Contact Form 7 Shortcodes

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages