> 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_inc_filepath_exclusions.md). Agents can also search and read this documentation through its [MCP server](https://whoisandywhite.gitbook.io/porterwp/~gitbook/mcp).

# porter\_wp\_inc\_filepath\_exclusions

Filters file and directory paths excluded from the recursive theme PHP scan.

```php
add_filter( 'porter_wp_inc_filepath_exclusions', function ( array $paths ) : array {
    $paths[] = 'experiments';
    $paths[] = 'integrations/legacy.php';
    return $paths;
} );
```

Paths are relative to the filtered include root and apply to the named item and its descendants. The default exclusion is `block/patterns` so PHP pattern content is not executed as theme bootstrap code.

Register this filter in the theme's `functions.php`, an MU plugin, or a plugin that loads before Porter's `init` priority 3 scan. A callback inside `porter/inc/` cannot exclude itself or another path from the scan already in progress.
