# ugly_form_html()

Source: https://uglydev.com/docs/functions/ugly-form-html/
Updated: 20 November 2026

`ugly_form_html( array $args ): string`

The same as [ugly_form()](https://uglydev.com/docs/functions/ugly-form/), but **returned instead of printed**. Use it when you build a string: inside a shortcode, a block or a template function that returns HTML.

```php
add_shortcode( 'contact_form', function () {
	return ugly_form_html( array(
		'groups'    => array( 'group_contact' ),
		'post_type' => 'message',
		'who'       => 'anyone',
	) );
} );
```

> **Pro:** Forms on the site are part of UglyFields Pro. The arguments are the same as in [Forms on the site](https://uglydev.com/docs/forms-bindings-rest-graphql/forms-on-the-site/).
