Contact Form Clean and Simple
A clean and simple AJAX contact form with Google reCAPTCHA, flexible CSS framework support, spam filtering, and REST API support for headless WordPress implementations. Clean: all user inputs are stripped in order to avoid cross-site scripting (XSS) vulnerabilities. Simple: AJAX enabled validation and submission for immediate response and guidance for your users (can be switched off). Flexible Styling: Choose your CSS framework – Bootstrap (default), Theme Native (inherits your theme’s styles), or Minimal (semantic classes for complete custom styling). REST API Support: Enable headless WordPress implementations to submit forms via authenticated REST API endpoints. Accessible: Built with accessibility in mind – proper ARIA attributes, keyboard navigation, screen reader support, and WCAG AA compliant color contrast. This is a straightforward contact form for your WordPress site. There is very minimal set-up required. Simply install, activate, and then place the short code [cscf-contact-form] on your web page. A standard set of input boxes are provided, these include Email Address, Name, Message and a nice big ‘Send Message’ button. When your user has completed the form an email will be sent to you containing your user’s message. To reply simply click the ‘reply’ button on your email client. The email address used is the one you have set up in WordPress under ‘Settings’ -> ‘General’, so do check this is correct. To help prevent spam all data is scanned can be scanned with Fullworks Anti Spam Pro. For this to work you must have the Fullworks Anti Spam Pro Plugin installed and activated. Fullworks Anti Spam Pro will also log all your messages, categorized as spam or not, automatically. For added piece of mind this plugin also allows you to add a ‘reCAPTCHA’. This adds a picture of a couple of words to the bottom of the contact form. Your user must correctly type the words before the form can be submitted, and in so doing, prove that they are human. Why Choose This Plugin? Granted there are many plugins of this type in existence already. Why use this one in-particular? Here’s why: Minimal setup. Simply activate the plugin and place the shortcode [cscf-contact-form] on any post or page. Safe. All input entered by your user is stripped back to minimise as far as possible the likelihood of any malicious user attempting to inject a script into your website. If the Fullworks Anti Spam Pro plugin is activated all form data will be scanned for spam. You can turn on reCAPTCHA to avoid your form being abused by bots, however Fullworks Anti Spam Pro will do this without reCAPTCHA. Ajax enabled. You have the option to turn on AJAX (client-side) validation and submission which gives your users an immediate response when completing the form without having to wait for the page to refresh. The form can integrate seamlessly into your website. Turn off the plugin’s default css style sheet so that your theme’s style sheet can be used instead. Flexible CSS styling: Choose from Bootstrap, Modern (with dark mode), Theme Native, or Minimal styling modes to match your site’s design. This plugin will only link in its jQuery file where it’s needed, it will not impose itself on every page of your whole site! Works with the latest version of WordPress. Original plugin written by an experienced PHP programmer, Megan Nicholas, the code is rock solid, safe, and rigorously tested as standard practice. Headless WordPress ready. REST API support allows you to submit forms from decoupled frontends, mobile apps, or any external application with proper authentication. Hopefully this plugin will fulfil all your needs. PHP 8 Ready Tested on PHP 8.4 How to Use Unless you want to change messages or add reCAPTCHA to your contact form then this plugin will work out of the box without any additional setup. Important: Check that you have an email address set-up in your WordPress ‘Settings’->’General’ page. This is the address that the plugin will use to send the contents of the contact form. To add the contact form to your WordPress website simply place the shortcode [cscf-contact-form] on the post or page that you wish the form to appear on. If you have Jetpack plugin installed disable the contact form otherwise the wrong form might display. Additional Settings This plugin will work out of the box without any additional setup. You have the option to change the default messages that are displayed to your user and to add reCAPTCHA capabilities. Go to the settings screen for the contact form plugin. You will find a link to the setting screen against the entry of this plugin on the ‘Installed Plugins’ page. Here is a list of things that you can change Message: The message displayed to the user at the top of the contact form. Message Sent Heading: The message heading or title displayed to the user after the message has been sent. Message Sent Content: The message content or body displayed to the user after the message has been sent. CSS Framework: Choose how the form is styled: Bootstrap (Default): Uses Bootstrap CSS classes for full Bootstrap compatibility. Best for themes already using Bootstrap. Modern (Card style): A beautiful, opinionated modern design with card-style layout, large inputs, and CSS variables for easy customization. Includes automatic dark mode support. Theme Native: Uses minimal classes with WordPress’s wp-element-button for the submit button. The form inherits your theme’s native form styles. Minimal: Uses semantic CSS classes only (cscf-field, cscf-input, etc.) for complete custom styling control. Use this plugin’s default stylesheet: The plugin comes with a default style sheet to make the form look nice for your user. Untick this if you want to use your theme’s stylesheet instead. The default stylesheet will simply not be linked in. This option is most relevant when using the Bootstrap CSS framework. Use client side validation (Ajax): When ticked the contact form will be validated and submitted on the client giving your user instant feedback if they have filled the form in incorrectly. If you wish the form to be validated and submitted only to the server then untick this option. Use reCAPTCHA: Tick this option if you wish your form to have a reCAPTCHA box. ReCAPTCHA helps to avoid spam bots using your form by checking that the form filler is actually a real person. To use reCAPTCHA you will need to get a some special keys from google https://www.google.com/recaptcha/admin/create. Once you have your keys enter them into the Public key and Private key boxes reCAPTCHA Public Key: Enter the public key that you obtained from here. reCAPTCHA Private Key: Enter the private key that you obtained from here. reCAPTCHA Theme: Here you can change the reCAPTCHA box theme so that it fits with the style of your website. Recipient Emails: The email address where you would like all messages to be sent. This will default to the email address you have specified under ‘E-Mail Address’ in your WordPress General Settings. If you want your mail sent to a different address then enter it here. You may enter multiple email addresses by clicking the ‘+’ button. Confirm Email Address: Email confirmation is now optional. To force your user to re-type their email address tick ‘Confirm Email Address’. It is recommended that you leave this option on. If you turn this option off your user will only have to enter their email address once, but if they enter it incorrectly you will have no way of getting back to them! Email Subject: This is the email subject that will appear on all messages. If you would like to set it to something different then enter it here. Override ‘From’ Address: If you tick this and then fill in the ‘From Address:’ box then all email will be sent from the given address NOT from the email address given by the form filler. **Option to allow enquiry to email themselves a copy of the message. Contact consent: This option allows you to be GDPR compliant by adding a ‘Consent to contact’ check box at the bottom of the form. Enable REST API: Turn on REST API support to allow headless WordPress implementations to submit forms. Required User Capability: Set the minimum WordPress user capability required to use the REST API (default: edit_posts). REST API for Headless WordPress This plugin includes REST API support, making it perfect for headless WordPress implementations, mobile applications, and decoupled frontend frameworks like React, Vue.js, or Angular. Enabling REST API Go to the plugin settings page Find the “REST API Settings” section Check “Enable REST API” Set the required user capability (default: edit_posts) Save your settings API Endpoint POST /wp-json/cscf/v1/submit Authentication The REST API requires WordPress user authentication. Users must be logged in and have the capability specified in settings (default: edit_posts). For headless implementations, you can use: – Application Passwords (WordPress 5.6+) – JWT Authentication plugins – OAuth plugins – Basic Authentication (development only) Request Format Send a POST request with JSON body: `json { “name”: “John Doe”, “email”: “
[email protected]”, “confirm_email”: “
[email protected]”, “message”: “Your message here”, “phone_number”: “+1234567890”, “contact_consent”: true, “email_sender”: false, “post_id”: 123 } ` Required fields: – name: Sender’s name – email: Sender’s email address – message: The message content Optional fields: – confirm_email: Required if email confirmation is enabled in settings – phone_number: Required if phone number is set as mandatory in settings – contact_consent: Required if contact consent is enabled in settings – email_sender: Set to true to send a copy to the sender – post_id: The ID of the page/post where the form would normally be displayed Response Format Success Response (200): json { "success": true, "message": "Message Sent" } Validation Error Response (400): json { "code": "validation_failed", "message": "Validation failed.", "data": { "status": 400, "errors": { "email": "Please enter a valid email address.", "message": "Please enter a message." } } } Authentication Error Response (401): json { "code": "rest_forbidden", "message": "Authentication required.", "data": { "status": 401 } } Example Implementation JavaScript (fetch API): `javascript const formData = { name: “John Doe”, email: “
[email protected]”, confirm_email: “
[email protected]”, message: “This is a test message from the REST API” }; fetch(‘https://yoursite.com/wp-json/cscf/v1/submit’, { method: ‘POST’, headers: { ‘Content-Type’: ‘application/json’, ‘Authorization’: ‘Bearer YOUR_AUTH_TOKEN’ }, body: JSON.stringify(formData) }) .then(response => response.json()) .then(data => { if (data.success) { console.log(‘Message sent successfully!’); } else { console.error(‘Validation errors:’, data.data.errors); } }); ` Important Notes REST API is disabled by default for security reCAPTCHA is bypassed for REST API submissions (authentication provides security) All other form validations and spam filtering still apply Form submissions via REST API are processed identically to regular submissions Email notifications work the same way as standard form submissions Demo Demo site coming soon.
Top keywords
- form33×1.84%
- email31×1.73%
- message25×1.39%
- api19×1.06%
- address18×1.00%
- rest18×1.00%
- user18×1.00%
- rest api17×0.95%
- recaptcha16×0.89%
- wordpress16×0.89%
- contact15×0.84%
- default12×0.67%
wpDataTables integration for Forminator Forms
wpDataTables integration for Forminator Forms is an add-on that connects the best WordPress table plugin wpDataTables and easy-to-use WordPress form builder Forminator. A powerful tool that adds “Forminator Form” as a new table type in wpDataTables and allows you to create responsive, sortable tables & charts based on Forminator Forms submissions from your site frontend using intuitive wpDataTables table and chart wizard. You will need to install wpDataTables and Forminator plugins to be able to use this integration. This great integration is compatible with wpDataTables Premium version and Forminator PRO and their advanced features. You can use any combination of these two plugins. Isn’t that awesome? When the form/quiz/poll is created and entries are ready, you can begin creating a wpDataTable based on it. First, go to wpDataTables -> Create a Table, choose “Create a table linked to an existing data source” option, and click “Next”. Then choose “Forminator Form” as the Input data source type. After you choose “Forminator Form” as a table type, a new select-box “Choose a Forminator Form” will appear. With this select-box, you can choose a form, quiz or poll, that will provide entries as data for your new table. After this step you will see a select-box “Choose fields to show as columns” that allows you to choose the form/quiz/poll fields that you will use as columns. Using this select-box, you can choose form fields that will be used in the table. Furthermore, you can choose which form fields will be shown in the table. Here is the list of the supported form fields: NEW! Slider Field (Single and Range) NEW! Group Field Name (Single and Multiple) Email Phone Address Website Input Textarea Number Radio Checkbox Calculations Select (Single and Multiple) Datepicker (Calendar, Dropdowns, and Text input) Timepicker ( Dropdowns and Number input) File Upload (Single and Multiple) Post Data Hidden Field Currency PayPal Stripe E-Signature (only available in Forminator PRO) Please note that fields like reCaptcha, HTML, Page break, Section, and GDPR Approval are excluded from tables. Important: For all form types that you want to create tables (form, quiz, or poll) you will need to have submission data for those form types in the database. That means that you need to turn off the option “Disable store submissions in my database” on Data Storage settings in the Forminator plugin. You will be able to save submissions in the database and then create a table in wpDataTables. Forms When you create a table from Regular form, in table column headers will be used names of your fields, and each row will be shown as a separate submission. Common fields such as Entry data, Entry ID, and User IP are available for each form. Fields like “Name (Multiple)” and “Address” will be formatted like on the Forminator forms Submissions page. If you want to show those data in one line with space between without formatting, you can use hooks for “Name(Multiple)” like in the following example: // Remove formatting from Name (Multiple) fields // $removeForminatorFormatting- false by default - bool // $formID - Id of the form - int function remove_style_from_name_multiply_fields($removeForminatorFormatting, $formID){ // Example for the form with id 1 if ($formID == 1){ // Provide true to remove formatting $removeForminatorFormatting= true; } return $removeForminatorFormatting; } add_filter('wdt_forminator_remove_style_from_name_multiply_fields', 'remove_style_from_name_multiply_fields', 10, 2); and for the “Address” fields as well you can show the data in one line separated with a comma using this hook: // Remove formatting from the Address fields // $removeForminatorFormatting- it is false by default - bool // $formID - Id of the form - int function remove_style_form_address_fields($removeForminatorFormatting, $formID){ // Example for form with id 1 if ($formID == 1){ // Provide true to remove formatting $removeForminatorFormatting= true; } return $removeForminatorFormatting; } add_filter('wdt_forminator_remove_style_form_address_fields','remove_style_form_address_fields', 10, 2); For the upload fields, there are some formatting rules applied depending on file extension. For image extensions (jpg, jpeg, png, gif, webp) the output will be formatted like image links. Files with the ‘mp3’ and ‘wav’ extensions will be formatted as audio HTML tags, and the files with ‘mp4’ and ‘webm’ extensions will be formatted as video HTML tags. If you need some different formatting rules for those upload fields you can use the following hook: // Filter formatted file URL // $fileURLOutput - Already formatted file URL - string // $fileURLExtension - File URL Extension (png,csv,pdf,mp4...) - string // $file - Original file URL - string function filter_file_upload_output($fileURLOutput, $fileURLExtension, $file, $formID){ // Example for form with id 1 if ($formID == 1){ // Example only for the jpg extension if ($fileURLExtension == 'jpg'){ // Set a custom image HTML tag with width of 400px $fileURLOutput = ' '; } } return $fileURLOutput; } add_filter('wdt_forminator_filter_file_upload_output', 'filter_file_upload_output', 10, 4); All other uploaded files will be formatted as HTML links. For the Website and email fields, there is no formatting rules applied from Forminator. If you need formatting rules from Formiantor for those fields (to be shown as links) you can use the following hook for Email field: // Add formatting from Formiantor for Email field // $removeForminatorFormatting- it is true by default - bool // $formID - Id of the form - int function remove_style_form_email_fields($removeForminatorFormatting, $formID){ // Example for form with id 1 if ($formID == 1){ // Provide false to add Forminator formatting as link $removeForminatorFormatting = false; } return $removeForminatorFormatting; } add_filter('wdt_forminator_remove_style_form_email_fields','remove_style_form_email_fields', 10, 2); and for Website field: // Add formatting from Formiantor for Website (URL) field // $removeForminatorFormatting- it is true by default - bool // $formID - Id of the form - int function remove_style_form_url_fields($removeForminatorFormatting, $formID){ // Example for form with id 1 if ($formID == 1){ // Provide false to add Forminator formatting as link $removeForminatorFormatting = false; } return $removeForminatorFormatting; } add_filter('wdt_forminator_remove_style_form_url_fields','remove_style_form_url_fields', 10, 2); New field support – Group field Now, support for Group fields is avalible with our integration as well. Every Group field in form will be shown as separate column and all fields that are in group will be parsed as table layout (in each cell you will have separate table as is shown on Formiantor submissions). Each field in group will be represent in the head of that table and entries from those fileds will be in the body of that table. If Repeater is enabled then those entries will be populated in table body as well. Additionally, there is a hook available for filtering all the formatted entries (only for forms and quizzes) // Filter all the formatted entries // $formattedEntry - Already formatted entry - string // $field - Forminator_Form_Field_Model - object // $entry - Forminator_Form_Entry_Model - object function filter_formatted_entry($formattedEntry, $field, $entry){ // Example for form with id 1 if ($entry->form_id == 1){ // Example only for custom forms if ($entry->entry_type == 'custom-forms'){ // Check is set meta data for current field if (isset($entry->meta_data[$field->slug])) { $entryValue = $entry->meta_data[$field->slug]['value']; // Check is field type 'name' and that is not array if ($field->raw['type']== 'name' && !is_array($entryValue)) { // if $entryValue is John return null - it will not be shown in the table if ($entryValue == 'John') $formattedEntry = null; } } } } return $formattedEntry; } add_filter('wdt_forminator_filter_formatted_entry','filter_formatted_entry', 10, 3); Quizzes You can create a table from the Personality and Knowledge quizzes. For quizzes, common fields like Entry Date and Entry ID are available. If lead generation feature is enabled, it will be available two more fields like Email and Name generated by this feature. When you create a table from a Knowledge quiz, in the table, questions will appear as column headers, and each row will be populated with the separate submission answers. For this type of quiz, three more fields are available like Correct answers, Incorrect answers and Score (Correct answers/Total answers). In that table, the answers will be formatted the same way as on the Forminator Submissions page. (correct answers have a green background and the wrong ones have a red background). When you create a table from the Personality quiz, questions will appear as column headers in that table. Also, the “Quiz result” will show up in the columns (if you choose it in the option “Choose fields to show as columns”), and each row will be shown as a separate submission answer. If you want to show answers from Knowledge quiz without their formatting, you can use the following hook: // Remove formatting from answers in Knowledge quiz // $removeForminatorFormatting - it is false by default - bool // $formID - Id of the form - int function remove_quiz_iscorrect_style($removeForminatorFormatting, $formID){ // Example for form with id 1 if ($formID == 1){ // Provide true to remove formatting $removeForminatorFormatting = true; } return $removeForminatorFormatting; } add_filter('wdt_forminator_remove_quiz_iscorrect_style','remove_quiz_iscorrect_style', 10, 2); Polls Polls entries in the Forminator submissions are shown as grouped values based on the answers. The same data can be displayed in a chart (Bar or Pie chart depending on your settings). In accordance with that, you can create tables based on the Forminator poll submissions either for the Bar chart or for the Pie chart structure, no matter what was chosen in the Forminator settings for the poll chart type. Polls do not have common fields like forms and quizzes. In the first case, if you select the Poll for Bar chart option, you can choose the columns to be created from the Poll question and Answers of that poll in the table. Only one row of data will be shown, since the data is grouped. After creating a table you are able to create a Google Bar chart and to show it on the front-end. In the second case, if you select the Poll for Pie chart option, you can choose only the columns to be created from the Poll answers and Total votes of that poll in the table. Then, the first column will list all the possible answers (Poll answers), and the second one (Total votes), will display grouped data for each answer. After creating a table, you can create a Google Pie chart and add it on the website page as well. If you need, you can show both charts (Pie and Bar) on the front-end for the same Poll. Integration settings Each Forminator form-based wpDataTable receives an extra Forminator settings tab on the table configuration page, together with several additional table settings. Using this tab, you can define which form entries will appear in the wpDataTable based on the range of entry IDs, entry date by choosing one of the two possible filtering logic options in the Filter by date select box. You can select between Filter by date range and Filter by the last X time period; or, you can leave this block empty if you don’t wish to filter form entries displayed in the table. Filter by entry ID range – Two input fields (“From” and “To”) are shown in this section. If you define some values in these number input fields, wpDataTable rows will be updated according to the selected range. Filter by date range – If you select this option, two input fields (“From” and “To”) will be displayed right to the Filter by date select box. By defining some date values in these datetimepicker input fields, wpDataTable rows will be narrowed down according to the provided date range. Filter by last X time period – When this option is selected, the Filter by date select box will display two input fields. In the first one, you can define a number (e.g., 30), and in the second one, you can choose between (Day(s), Week(s), Month(s), and Year(s)). By selecting, e.g., “30 Day(s)” you will filter and display in the wpDataTable only the entries added in the last 30 days in the Forminator Form used as a data source for this wpDataTable. In those tables, you can use all features that are included in wpDataTables: NEW! Create 9 different Chart.js charts types, NEW! Responsive datatables NEW! Integration with Avada Website builder NEW! Integration with DIVI Website builder NEW! Caching data NEW! Auto update cache data NEW! FULL Frontend WCAG compatibility NEW! Responsive Charts – now each chart (both Google and Chartjs) can be responsive NEW! Grouping Charts – rows with same labels would be treated as a single entry, summing up all the values in other cells Global search, Sorting, Column visibility, Pagination, Show rows per page, Row grouping, Table layout, Scrollable, Export data (in Excel, CSV, PDF, Copy or Print), Create 14 different Google charts types, Global and , Column customization If, apart from creating tables based on the Forminator forms data, you would also like to create tables from scratch or from other data sources, wpDataTables provides more options for you: NEW! Create tables from Nested JSON – Text and video documentation Create Simple tables from scratch – Text and video documentation Create tables from Excel – Text and video documentation Create tables from CSV – Text and video documentation Create tables from JSON – Text and video documentation Create tables from XML – Text and video documentation Create tables from Serialized PHP array – Text and video documentation To check out the table on the front-end you can insert wpDataTables shortcode in your page or post (for example [wpdatatable id=1]) or with page widgets/blocks if you are using some of the page builders like WP Bakery, Elementor or Gutenberg. Limitation Those tables do not have a server-side option (this means that these tables can’t contain a large amount of data (no exact limit, but 2.000 – 3.000 rows is a good example)), and that they cannot be editable.