> For the complete documentation index, see [llms.txt](https://docs.objectiphy.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.objectiphy.net/query-builder/delete-queries.md).

# Delete Queries

You can use a delete query to delete entities that match the given criteria.

```php
$query = QB::create()
    ->delete(TestContact::class)
    ->where('isPermanent', '=', false)
    ->buildDeleteQuery();
$count = $repository->executeQuery($query);
```

You can perform more complex filtering operations using [criteria](/query-builder/criteria.md) and [joins](/query-builder/joins.md) as with other types of query.
