> For the complete documentation index, see [llms.txt](https://whoisandywhite.gitbook.io/porterwp/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://whoisandywhite.gitbook.io/porterwp/developer-api/hooks/porter_wp_config_filepath.md). Agents can also search and read this documentation through its [MCP server](https://whoisandywhite.gitbook.io/porterwp/~gitbook/mcp).

# porter\_wp\_config\_filepath

Filters the directory containing a requested Porter JSON file.

```php
add_filter( 'porter_wp_config_filepath', function ( string $directory, string $file ) : string {
    if ( 'porter.json' === $file ) {
        return get_stylesheet_directory() . '/config/porter';
    }
    return $directory;
}, 10, 2 );
```

The default directory is `porter/config` below the active stylesheet. Return a directory, not the final file path: Porter appends `$file` after the hook. The resolved directory and file metadata are included in cache signatures.

Register this filter in the theme's `functions.php`, an MU plugin, or an earlier plugin. Do not place it in `porter/inc/`: configuration consumers such as theme-support setup run on `after_setup_theme`, before Porter loads that directory on `init`.
