Skip to content
Custom fields for WordPress that are quick to build and quick to load. Get Pro
Docs

Forms, REST and languages

Make a contact form that saves to the sitePro

1 minute to read Updated 1 week ago Needs UglyFields Pro

The contact form on the site, drawn with the theme style
The contact form on the site, drawn with the theme style.
  1. Make a field group Contact with a Text name, an Email email and a Text area message.
  2. In your template, or as a shortcode in a page:
PHP
ugly_form( array(
	'groups'    => array( 'group_contact' ),
	'post_type' => 'message',
	'status'    => 'pending',
	'who'       => 'anyone',
	'submit'    => 'Send',
	'notify'    => 'hello@example.com',
) );
[ugly_fields_form groups="group_contact" post_type="message" who="anyone"]

A visitor cannot publish: their post waits for review. It has its own token, a honeypot, a minimum time and limits of tries. Fields that cannot go in a form (an image, a file, rich text) are left out, and the person who builds the site sees a notice that lists them. See Forms.

Did this article answer your question?