How to Create Custom Forms in WordPress

How to Create Custom Forms in WordPress with Divine Smart Forms

WordPress site owners in 2026 are looking for fast, secure, and highly visual ways to collect data. Whether you need a simple contact form, a multi‑step registration flow, or a complex survey that feeds directly into Google Sheets, Divine Smart Forms provides a modern WordPress form builder that works flawlessly with the latest WordPress 6.8 core. In this step‑by‑step guide we’ll walk you through creating custom WordPress forms using the drag‑and‑drop interface, share best‑practice tips for performance and security, and answer the most common questions new users have.

Why Choose Divine Smart Forms for Custom WordPress Forms?

  • Visual Form Builder – Build forms in real time with a block‑style canvas (see the visual form builder feature page for a live demo).
  • Native WordPress 6.8 compatibility – Leverages the block editor (Gutenberg) and the new wp_safe_remote_request() API for faster AJAX submissions.
  • Spam protection built‑in – Uses reCAPTCHA v3, Honeypot, and AI‑driven bot detection (learn more at Spam Protection).
  • Google Sheets integration – Send entries directly to a spreadsheet without a third‑party Zapier account (Google Sheets Integration).
  • Developer friendly – Full shortcode support, REST API endpoints, and hookable actions for custom extensions.

Step‑by‑Step Walkthrough: Building Your First Custom Form

  1. Install and activate Divine Smart Forms. From your WordPress 6.8 dashboard go to Plugins → Add New, search for “Divine Smart Forms,” click Install Now, then Activate. The plugin adds a new top‑level menu called Divine Smart Forms.
  2. Create a new form. Navigate to Divine Smart Forms → Add New Form. You’ll be greeted by a blank canvas with a + Add Field button at the top.
  3. Drag‑and‑drop your fields. Choose from Text, Email, Phone, File Upload, Radio, Checkbox, Date Picker, and the new AI‑Generated Question field (introduced in 2026). Simply click a field, drag it onto the canvas, and drop it where you want it to appear.
  4. Configure field settings. Click any field to open the side panel. Here you can set:
    • Label and placeholder text.
    • Field validation rules (e.g., required, min/max length, regex).
    • Conditional logic (show/hide based on previous answers).
    • Custom CSS classes for advanced styling.
  5. Set up form actions. At the bottom of the canvas click Form Settings. In the Actions tab you can enable:
    • Email notifications (choose multiple recipients, HTML template).
    • Database storage – every entry is saved in a custom table that follows the WordPress 6.8 wpdb schema.
    • Google Sheets integration – simply paste your Sheet ID and map fields.
    • Redirect after submit – send users to a thank‑you page or a custom URL.
  6. Enable spam protection. Switch to the Spam Protection tab and toggle reCAPTCHA v3, enable the Honeypot field, or activate the AI‑Bot Detector that analyzes submission patterns in real time.
  7. Save and publish. Click Save Form. You’ll receive a unique form ID. Insert the form anywhere on your site with the shortcode: [divismfo_form id="123"] (replace 123 with your actual form ID).
  8. Test the form. Visit the page where you added the shortcode, fill out the fields, and submit. Check the Entries tab in the plugin dashboard to verify that data is recorded and that email notifications are delivered.

Best Practices for High‑Performance Custom Forms in 2026

  • Load forms asynchronously. Enable the “Lazy Load Form” option in Form Settings → Performance. This adds the form only after the page’s primary content has rendered, reducing First Contentful Paint (FCP) scores.
  • Leverage native Gutenberg blocks. In WordPress 6.8 you can add the “Divine Smart Form” block directly from the editor, which automatically inherits the theme’s CSS variables for seamless design.
  • Minimize field count. Only ask for information you truly need. Fewer fields improve conversion rates and lower the chance of spam triggers.
  • Use server‑side validation. While client‑side checks improve UX, always validate data with PHP using the divine_smart_forms_validate filter to protect against malicious payloads.
  • Secure data storage. Divine Smart Forms encrypts entries at rest using WordPress 6.8’s WP_Encryption API. For GDPR compliance, enable the “Data Retention” schedule and provide a “Delete My Data” endpoint.
  • Cache form assets. The plugin bundles its CSS/JS with versioned filenames (e.g., dsf‑bundle.6.8.0.min.js) so you can safely add them to your CDN cache‑control rules.
  • Regularly update. WordPress 6.8 introduced stricter sanitization for AJAX requests. Keep Divine Smart Forms updated to the latest 2026 release to stay compatible with these core changes.

Advanced Customization Using Shortcodes and Hooks

Developers can extend the default functionality without touching core files. Below are two common scenarios.

1. Pre‑populate fields with user meta

add_filter( 'divine_smart_forms_shortcode_atts', function( $atts ) { if ( is_user_logged_in() && $atts['id'] == '123' ) { $current_user = wp_get_current_user(); $atts['default_values'] = array( 'email' => $current_user->user_email, 'name' => $current_user->display_name, ); } return $atts; });

2. Add a custom post‑submission action

add_action( 'divine_smart_forms_after_submit', function( $entry, $form_id ) { if ( $form_id == 123 ) { // Example: create a custom post type from the submission. wp_insert_post( array( 'post_title' => sanitize_text_field( $entry['title'] ), 'post_content' => wp_kses_post( $entry['message'] ), 'post_type' => 'lead', 'post_status' => 'publish', ) ); } }, 10, 2 );

These snippets belong in your theme’s functions.php file or a site‑specific plugin. For a complete library of hooks, visit the Divine Smart Forms documentation hub.

FAQ – Frequently Asked Questions

  • Q: Does Divine Smart Forms work with the WordPress block editor?
    A: Yes. The plugin registers a Gutenberg block that you can drop into any post or page. The block respects the latest WordPress 6.8 layout settings and supports full‑width, wide‑align, and column patterns.
  • Q: How does the plugin handle GDPR and data privacy?
    A: All entries are stored encrypted, and the Data Retention tab lets you set automatic deletion periods (30, 60, 90 days). Users can request removal via a built‑in “Delete My Data” link that triggers the divine_smart_forms_delete_entry action.
  • Q: Can I integrate the form with third‑party CRMs?
    A: Absolutely. The Integrations panel includes native connectors for HubSpot, Salesforce, and the new 2026‑compatible Google Sheets integration. For other services, use the divine_smart_forms_before_send hook to push data via REST.
  • Q: Is there a limit to the number of forms I can create?
    A: The free version allows up to 5 active forms, each with up to 25 fields. The Pro license lifts all limits and adds premium field types such as Signature and Payment.
  • Q: How can I improve form loading speed on mobile?
    A: Enable “Lazy Load” and “Minify Assets” in the