# On the way out

Source: https://uglydev.com/docs/security/on-the-way-out/
Updated: 19 November 2026

- **Everything printed is escaped for where it goes.** `ugly_show()` picks the right way for each type of field, so you cannot forget it.
- **`ugly_get()` is raw on purpose.** It gives you the value to decide things with. You escape where it matters, with `esc_html()`, `esc_url()` or `esc_attr()`.
- **The templates written from a group** never carry text from a title, a label or a name as code.
- **A `<` in a text field stays a `<`** in Block Bindings.

## The rule that keeps a site safe

| You do | Safe? |
| --- | --- |
| `ugly_show( 'name' )` | Yes. Escaped for its type |
| `echo esc_html( ugly_get( 'name' ) )` | Yes |
| `echo esc_url( ugly_get( 'link' )['url'] )` | Yes |
| `echo ugly_get( 'name' );` | **No**, unless the field is rich text, which is ready HTML. For any other type, escape |
| Putting `ugly_get()` inside a `<script>` or a `style=""` without `wp_json_encode()` or `esc_attr()` | **No** |
