# Write the JSON files in another folder

> By default the files are written in ugly-json/ of your theme. Two filters change it: ugly_json_paths (where files are read from) and ugly_json_save_path (where they are written).

Source: https://uglydev.com/docs/how-do-i-git-and-deploys/write-the-json-files-in-another-folder-2/
Updated: 20 November 2026

**You want:** the JSON files of your groups in **another folder** of the theme, not in `ugly-json/`.

```php
add_filter( 'ugly_json_save_path', function () {
	return get_stylesheet_directory() . '/config/fields';
} );
```

> **Inside the theme:** The folder must stay **inside your theme**: a path with `../` is not followed. This keeps the plugin from writing files where it should not.

See [Hooks and filters](https://uglydev.com/docs/hooks-and-filters/) for every filter of this kind.
