Copying a contact form to another WordPress site
Export the form as a file on the first site and import it on the second. A good export carries the fields, the mail settings and the messages, so the copy works immediately. For an agency with a standard enquiry form, it turns a half-hour of setup per client site into a minute.
What should travel with a form
- The fields, in order, with labels, types, options, help text and which are required.
- The notification: recipients, subject, message and Reply-To.
- The automatic reply, if there is one.
- The confirmation and all the error messages, especially if you've translated or reworded them.
What shouldn't travel: entries (they're personal data and belong to the old site), and anything specific to that site, such as which page a redirect goes to.
Doing it with Mailbag
Mailbag Contact Form exports forms as JSON — a plain text file you can keep, email or put under version control. Import the file on the other site and the form arrives complete, with a new id there. Recipients written as {admin_email} automatically mean the new site's admin address, so a form built on your own agency site doesn't keep sending to you.
The import checks the file before creating anything. A file with a field type Mailbag doesn't know is refused, naming the type, instead of creating a form with a hole in it.
Keeping a library of standard forms
Agencies often keep a folder of exported forms: a contact form, a quote request, a callback request, each with the house wording and a sensible autoreply. Import the right one on each new site, change the recipient if it isn't the site admin, and place it with the block or shortcode.
Moving from Contact Form 7 instead?
If the forms are still in Contact Form 7, don't export anything: Mailbag's importer reads CF7's forms directly — see switching from Contact Form 7.
Mailbag Contact Form is a free contact form that saves every entry before it sends anything, and shows you what happened to each email.
See what it does