Forms5M+ users

Contact Form 7 Alternative for Next.js & Astro

The most popular WordPress form plugin. Learn how to replace Contact Form 7 with modern, serverless form solutions.

TL;DR

You don't need Contact Form 7 after migrating to Next.js or Astro. Modern frameworks offer built-in solutions or lightweight npm packages that replace Contact Form 7 with better performance and zero plugin bloat. See the alternatives below.

Official docs: Next.js Documentation · Astro Documentation

The Problem with Contact Form 7

Contact Form 7 requires server-side PHP processing, is vulnerable to spam, and adds unnecessary complexity to your stack.

Modern Alternatives

Formspree

A form backend service that works with any static site.

service

Pros

  • No backend needed
  • Spam protection
  • Free tier available
  • Easy setup

Cons

  • External dependency
  • Paid for high volume

How to Implement

Point your form action to Formspree endpoint. They handle validation and delivery.

React Hook Form + API Route

Build a custom form with React Hook Form and handle submissions via API routes.

code

Pros

  • Full control
  • No external services
  • Type-safe

Cons

  • More setup required
  • Need email service

How to Implement

Create a form component with React Hook Form, then create an API route to handle submissions via SendGrid or Resend.

Tally

A beautiful, free form builder with powerful features.

service

Pros

  • Visual builder
  • Free forever plan
  • No-code

Cons

  • External service
  • Less customizable styling

How to Implement

Create your form in Tally and embed it in your site using their provided code.

Migration Steps

1

Document your existing CF7 form fields

2

Choose a replacement solution

3

Recreate form structure

4

Set up form submission handling

5

Configure email notifications

6

Add spam protection (honeypot, reCAPTCHA)

7

Test thoroughly

Code Example

// Using React Hook Form with API Route
'use client';
import { useForm } from 'react-hook-form';

export function ContactForm() {
  const { register, handleSubmit } = useForm();
  
  const onSubmit = async (data) => {
    await fetch('/api/contact', {
      method: 'POST',
      body: JSON.stringify(data),
    });
  };
  
  return (
    <form onSubmit={handleSubmit(onSubmit)}>
      <input {...register('name')} placeholder="Name" />
      <input {...register('email')} type="email" />
      <textarea {...register('message')} />
      <button type="submit">Send</button>
    </form>
  );
}

Frequently Asked Questions

How do I handle file uploads without CF7?
Use services like Uploadthing, Cloudinary, or create an API route that uploads to S3/R2.
What about conditional fields?
React Hook Form supports conditional rendering natively with JavaScript. It's more powerful than CF7's conditional logic.

Guides for Replacing Contact Form 7

In-depth guides and tutorials to help with your migration

Ready to Leave WordPress Behind?

Migrate your entire WordPress site to Next.js - including replacing Contact Form 7 functionality.

Start Free Migration

Browse all migration guides →