Title: Ajax Contact Form
Author: Olaf Lederer
Published: <strong>2014 年 8 月 20 日</strong>
Last modified: 2025 年 10 月 29 日

---

搜索插件

![](https://ps.w.org/fws-ajax-contact-form/assets/banner-772x250.jpg?rev=2457787)

![](https://ps.w.org/fws-ajax-contact-form/assets/icon-256x256.png?rev=2457787)

# Ajax Contact Form

 作者：[Olaf Lederer](https://profiles.wordpress.org/finalwebsites/)

[下载](https://downloads.wordpress.org/plugin/fws-ajax-contact-form.1.5.6.zip)

 * [详情](https://cn.wordpress.org/plugins/fws-ajax-contact-form/#description)
 * [评价](https://cn.wordpress.org/plugins/fws-ajax-contact-form/#reviews)
 *  [安装](https://cn.wordpress.org/plugins/fws-ajax-contact-form/#installation)
 * [开发进展](https://cn.wordpress.org/plugins/fws-ajax-contact-form/#developers)

 [支持](https://wordpress.org/support/plugin/fws-ajax-contact-form/)

## 描述

This free contact form plugin is used to create accessible contact forms with advanced
spam protection (honeypot, cookie and optionally Cloudflare Turnstile or hCaptcha).
In contrary to most other form plugins, there is no form-builder included.

#### Features

 * The generated form is accessible and works even when the visitor has disabled
   Javascript
 * Accessible form field validation
 * Protect your forms against spam bots using a honeypot and cookies
 * Track successfully submitted forms in Google Analytics and/or Clicky
 * Create multiple contact forms via an easy to use interface and add the form via
   the block editor or using a shortcode
 * Collect form submissions for all your forms or the forms you choose
 * Get insights which spam protection feature works the best for your form. A simple
   log file keeps track about the different spam attempts
 * Multiple responder emails, send a HTML formatted mail in response to the form
   submission
 * Works with the default wp_mail() function (use it together with the [Maileroo](https://wordpress.org/plugins/simple-smtp-by-maileroo/)
   plugin to send emails via SMTP)
 * Optional: Protect your forms by blocking specific countries which are not relevant
   for your website or business
 * Optional: Protect your contact form with the plugin [WP Armour – Honeypot Anti Spam](https://wordpress.org/plugins/honeypot/)
 * Optional: Email address verification with the verification API from [Maileroo](https://maileroo.com/?r=acfplugin)
 * Optional: Form fields for Company name, phone number, website and an accept terms
   checkbox
 * Optional: Redirect the visitor after a succesful form submission to a “Thank 
   you” page
 * Optional: Use the plugin’s CSS style-sheet for your forms
 * Optional: Protect your forms with Cloudflare Turnstile or hCaptcha
 * Optional: For additional spam protection, you can add a simple and accessible
   challenge to your form.

The plugin is built to keep stuff simple. If you need a complex web form or if you
need a form builder, please use one of the form plugins you can find in the WordPress
repository. To use the “Block countries” feature we use the IP to Country API from
Country.is. They offer a free service and you don’t need an API key.

## 屏幕截图

 * [[
 * An example of how the form looks like.
 * [[
 * Plugin settings.
 * [[
 * Default form settings.
 * [[
 * The new form/post interface.
 * [[
 * Example post for the submission storage.
 * [[
 * Create the responder mail message.
 * [[
 * Advanced spam settings.

## 区块

该插件提供了 1 个区块.

 *   Ajax Contact Form Form

## 安装

The quickest method for installing the contact form is:

 1. Automatically install using the built-in WordPress Plugin installer or…
 2. Upload the entire `fws-ajax-contact-form` folder to the `/wp-content/plugins/` 
    directory.
 3. Activate the plugin through the ‘Plugins’ menu in WordPress.
 4. Visit “Settings” and enter the necessary options. All options are explained on 
    the contact form settings page.
 5. Create a new form-post and add the form via the block editor or place the shortcode`[
    fws_contact_form id="X"]`. X is the number of the form post.
 6. Optionally create a responder email message and choose the post via the form you’ve
    created before.

Visit [our website](https://www.finalwebsites.com/ajax-contact-form-wordpress/) 
for additional information.

## 常见问题

### How to add a manual goal in Clicky?

If you use a Clicky premium plan it’s possible to track Goals.

 1. In Clicky, go to Goals > Setup > Create a new goal.
 2. Enter a name for the goal
 3. Check the “Manual Goal” checkbox and click Submit
 4. Copy/paste the ID into the field from the plugin options page

### How to use the “fwsacf_after_success_form” action hook?

Use the following action hook in your theme’s function.php file. For example you
can submit the email address and name to your CRM or email marketing system to send
out some follow up emails.

    ```
        add_action('fwsacf_after_success_form', function($form) {
                // Your code here...
                // and use the array values $form['email'] and $form['name'] where needed
            });
    ```

### How to use the dynamic subject feature?

Using this feature is easy, just add the subject text as query string to the page
URL where your contact form is located, for example: https://domain.com/contact/?
dynsubject=yourtexthere

### How can I report security bugs?

You can report security bugs through the Patchstack Vulnerability Disclosure Program.
The Patchstack team help validate, triage and handle any security vulnerabilities.
[Report a security vulnerability.](https://patchstack.com/database/wordpress/plugin/fws-ajax-contact-form/vdp)

## 评价

此插件暂无评价。

## 贡献者及开发者

「Ajax Contact Form」是开源软件。 以下人员对此插件做出了贡献。

贡献者

 *   [ Olaf Lederer ](https://profiles.wordpress.org/finalwebsites/)

「Ajax Contact Form」插件已被翻译至 1 种本地化语言。 感谢[所有译者](https://translate.wordpress.org/projects/wp-plugins/fws-ajax-contact-form/contributors)
为本插件所做的贡献。

[帮助将「Ajax Contact Form」翻译成简体中文。](https://translate.wordpress.org/projects/wp-plugins/fws-ajax-contact-form)

### 对开发感兴趣吗?

您可以[浏览代码](https://plugins.trac.wordpress.org/browser/fws-ajax-contact-form/)，
查看[SVN仓库](https://plugins.svn.wordpress.org/fws-ajax-contact-form/)，或通过[RSS](https://plugins.trac.wordpress.org/log/fws-ajax-contact-form/?limit=100&mode=stop_on_copy&format=rss)
订阅[开发日志](https://plugins.trac.wordpress.org/log/fws-ajax-contact-form/)。

## 更新日志

#### 1.5.6

 * Enhancement
    - Improved authentication for non-JS sessions. Spam checks that use JavaScript
      are now bypassed when JS is disabled.
    - Formfield validation for form post and responder, the important fields are
      now checked when saving.
    - The possibility to add multiple to: email addresses.
    - Bcc: Option for responder emails.
    - Option to add a reply-to header based on the sender’s email address.
 * Other
    - We removed the Google reCaptcha integration, use Cloudflare Turnstile or hCapchta
      instead.

#### 1.5.5.1

 * Bug fixes
    - The function that creates the directory for the spam attempt log file was 
      missing.

#### 1.5.5

 * Enhancement
    - A log file to monitor spam attempts. Get insights which spam protection feature
      works the best for your form(s). Enable this feature via the advanced spam
      options.
    - Added a new Gutenberg block to insert the shortcode from a list
    - Added spam protection with Cloudflare Turnstyle. Add your API keys to enable
      the function.
    - The message for the site owner has been updated; it now only displays the 
      values of the completed fields. A link to the submission post is also displayed.
    - The shortcode of a form is now also shown in the list of forms
    - The Mailer Email Verification API no longer requires a valid API key. You 
      can enable or disable it.
    - For added spam protection, you can now add a challenge to your form. See [our guide](https://www.finalwebsites.com/ajax-contact-form-wordpress/)
      for more information.
    - If an external service (Mailroo, Cloudflare Turnstile, or hCaptcha) is unavailable,
      the validation function will always return a valid validation. This is necessary
      to prevent legitimate visitors from using your contact form. This will rarely
      happen, but it’s just a safety precaution.
 * Other
    - Google’s reCaptcha security is inaccessible and has therefore been completely
      removed. Use Cloudflare Turnstile or hCaptcha instead.

#### 1.5.4

 * Enhancement
    - Changed the table layout for the admin message to make it better readable (
      on mobile).
    - Added the country code to the meta data for the admin message.
    - Added an option to block submission with URL’s inside the message
    - Moved some settings to the new tab “Advanced anti-spam settings”
    - Improved the form submission log detail page

#### 1.5.3

 * Enhancement
    - (Beta) Option to verify/block disposable email addresses
    - Added a new option to change the delay value (15 seconds) for form submissions
 * Other
    - The “fwsacf_after_success_form” action hook has been around for a while. [Our manual](https://www.finalwebsites.com/ajax-contact-form-wordpress/)
      now includes an example showing you how to send a subscriber to EmailOctopus
      using the hook.

#### 1.5.2

 * Bug fixes
    - Added extra validation for the external email verification API
    - Fixed some warnings for empty variables
 * Enhancement
    - Added a blueprint.json file for quick testing

#### 1.5.1

 * Bug fixes
    - There was an issue with Maileroo email verifification, which is fixed
 * Enhancement
    - After submitting a form (via Ajax), the window scrolls now to the position
      of the message.

#### 1.5.0

 * Enhancement
    - Each form works now without Javascript.
    - Email verification via the Maileroo API
    - Better and accessible form field validation features
    - Many updates for accessibility
    - Admin notifications using the HTML email template

#### 1.4.1

 * Bug fixes
    - Fixed and issue inside the Ajax response. The message after submitting a form
      is working again.
    - Added a test for existing post meta fields, that the form defaults are used
      im logical way.

#### 1.4.0

 * Enhancement
    - Improved the form submission data page
    - New form fields for company, phone number, website and accept terms
    - Expanded the form field validation for the new fields
    - Validation (client and server side) for the accept terms option
    - Improved the form style

#### 1.3.0

 * Enhancement
    - With this version it is possible to enter a form via a post/form interface.
      The shortcode function still exists, but I advise to convert your forms as
      soon as possible.
    - The reply-to header is removed, because this header can increase the risk 
      that your notification will go into the spam box.
    - The settings page has been re-organized.
    - Minor text changes

#### 1.2.6

 * Bug fixes
    - Code optimization, mainly adding additional cleanup functions to variables.

#### 1.2.5.1

 * Bug fixes
    - Another fix for the settings page.

#### 1.2.5

 * Bug fixes
    - Fixed and updated the settings page (which was broken after the last update)

#### 1.2.4

 * Enhancement
    - We replaced the IP Stack API with Country.is. Their API service is free and
      no API key is required. You don’t need to change anything.

#### 1.2.3

 * Enhancement
    - Enable/disable the collection of form submissions globally or for each form

#### 1.2.2

 * Enhancement
    - Integration with WP Armour – Honeypot Anti Spam

#### 1.2.1.1

 * Bug fixes
    - Removed the “pause(500)” JS function which was used to delay Clicky tracking
      in previous versions.

#### 1.2.1

 * Enhancement
    - Responsive email template for the responder emails
    - Two new fields for the responder email (pre header and footer)

#### 1.2.0

 * Enhancement
    - New feature: Spam protection via hCaptcha (as an privacy friendly alternative
      to Google reCAPTCHA)
    - New feature: Spam protection using a honeypot and cookies. Note, from now 
      these two options are always.
    - Some style corrections to play a bit nicer with the Captcha challenges.
    - Updated the Dutch translations

#### 1.1.4.1

 * Bug fixes
    - removed some un-commented debug code from the plugin file
    - fixed an error for the Google Analytics tracking inside the JS file

#### 1.1.4

 * Enhancement
    - New feature: Contact form submission, all submitted forms are stored in a 
      custom post type.
    - New feature: Send out responder emails to the person who send you a message
      via your contact form.
    - The plugin has now a custom menu where you can find the submissions and the
      plugin settings.

#### 1.1.3.1

 * Bug fixes
    - In some situations the reCAPTCHA response was requested too late. We changed
      the function to get working. Please post to the WordPress forums if you see
      any issues.

#### 1.1.3

 * Enhancement
    - Use the new action hook “fwsacf_after_success_form” to add your custom functionality
      right after the form was submitted successfully. Check the FAQ for an example.
    - New shortcode attribute for an optional class inside an HTML form element.
    - Dynamic subject, check the FAQ for information on how to use this function.
 * Other
    - You can now show or hide the phone number field via the shortcode attribute“
      show_phone”.
    - Fixed the tabindex sequence because of the optional form fields
    - Changed form CSS style a little (including some cleanup)
    - Updated the Dutch translations

#### 1.1.2

 * Enhancement
    - We moved the options page code from the plugin file to a separate options 
      page file. This way it’s easier to add more options (in the future).
    - New feature: Add a thank you page. Enter the URL and the visitor is redirected
      to a page of your choice (after the contact form was successfully submitted).
    - All static assets are moved to the new directory “assets”

#### 1.1.1

We solved a bug for the reCAPTCHA function. There was a problem inside the code,
which marked a message as spam if it takes more than 2 minutes to send a message.
Just update and the problem is gone.

 * Enhancement
    - We changed the JavaScript code a bit to prevent a double submission (which
      was also a problem for the reCAPTCHA verification).

#### 1.1.0

After more than 3 years a new version. The plugin worked during the whole time and
it was compatible with all past WordPress versions (I use the plugin on my own website).
This version has some new features and the Mailgun email address validation is removed.
Please check the settings page after the update and modify the settings if necessary.
Check also the translations, besides the news string, some of them are replaced 
by new ones.

 * Enhancement
    - New feature: Prevent spam by blocking countries if they are not relevant for
      your website.
    - New feature: Fight spam using Google reCAPTCHA v3.
    - Update: The tracking feature for Google Analytics is updated. We now support
      the gtag.js version.
    - Update: The feature for multiple subjects is improved.
    - Update: The callback function is now using WordPress functions for sanitizing
      the field values.
    - Update: The form has now a field for a phone number (it’s not a required field)
 * Other
    - The Mailgun email address validation feature is removed.

#### 1.0.5.1

 * Other
    - The plugin is tested for WordPress 4.8.1

#### 1.0.5

 * Other
    - Replaced the link for the “Codestyling Localization” plugin. The plugin doesn’t
      exist anymore, I added a link to “Loco Translate” instead.
    - The plugin is tested for WordPress 4.2
    - Bug fixes
    - Fixed some issues with the (Dutch) translation files
 * Enhancement
    - The contact form message is filtered now by using the function wp_kses() before
      the message is added to the email message

#### 1.0.4

 * Other
    - Added .pot file for translations
 * Bug fixes
    - Removed the IF statement for the API key value inside the shortcode function.
      Since version 1.03 the API key isn’t required anymore.
    - Fixed a view option name values inside the function FWS_ajax_contactform_action_callback()
 * Enhancement
    - Added Dutch translations
    - Added a new option to change the “thank you message” (I keep the old text 
      as fallback option)
    - Code optimizations (replaced standard PHP functions and code with native WordPress
      functions)
    - Added default options to plugin values (where possible)
    - New: Uninstall function – All plugin option are gone on removal

#### 1.0.3

 * Other
    - Added updated screenshots
 * Bug fixes
    - The object name used for wp_localize_script is changed because of possible
      conflicts with other plugins or themes
 * Enhancement
    - The Mailgun email address validation feature is now optional. The validation
      process is also moved from client side code (JS) to the server side code (
      PHP).
    - Before the form gets submitted, a simple email address validation (regular
      expression) is done.
    - Now it’s possible to enter multiple subjects for the email message. These 
      subjects are used to create a SELECT menu for the contact form
    - It’s possible now to translate the complete plugin

#### 1.0.2.1

 * Other
    - Added icons for the plugin repository
    - The plugin is tested for WordPress 4.0
    - Added instructions for using the track Clicky goal feature
    - Added an updated screenshot for the plugin settings

#### 1.0.2

 * Bug fixes
    - Removed some typos in the text
 * Enhancement
    - Simple goal or conversion tracking for Google Analytics and Clicky

#### 1.0.1

 * Bug fixes
    - Fixed the name for the nonce verification
    - Removed the bug for the wrong addressing of the Ajax call back function
 * Enhancement
    - Added some screenshots and FAQ’s
    - Overwrite the mail subject global setting by using a shortcode attribute

#### 1.0

 * Initial release

## 额外信息

 *  版本 **1.5.6**
 *  最后更新：**6 月前**
 *  活跃安装数量 **20+**
 *  WordPress 版本 ** 5.4 或更高版本 **
 *  已测试的最高版本为 **6.8.5**
 *  语言
 * [Dutch](https://nl.wordpress.org/plugins/fws-ajax-contact-form/) 和 [English (US)](https://wordpress.org/plugins/fws-ajax-contact-form/).
 *  [翻译成简体中文](https://translate.wordpress.org/projects/wp-plugins/fws-ajax-contact-form)
 * 标签
 * [accessible](https://cn.wordpress.org/plugins/tags/accessible/)[antispam](https://cn.wordpress.org/plugins/tags/antispam/)
   [contact form](https://cn.wordpress.org/plugins/tags/contact-form/)[email log](https://cn.wordpress.org/plugins/tags/email-log/)
   [forms](https://cn.wordpress.org/plugins/tags/forms/)
 *  [高级视图](https://cn.wordpress.org/plugins/fws-ajax-contact-form/advanced/)

## 评级

尚未提交反馈。

[Your review](https://wordpress.org/support/plugin/fws-ajax-contact-form/reviews/#new-post)

[查看全部评论](https://wordpress.org/support/plugin/fws-ajax-contact-form/reviews/)

## 贡献者

 *   [ Olaf Lederer ](https://profiles.wordpress.org/finalwebsites/)

## 支持

有话要说吗？是否需要帮助？

 [查看支持论坛](https://wordpress.org/support/plugin/fws-ajax-contact-form/)