# 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](https://docs.objectiphy.net/query-builder/criteria) and [joins](https://docs.objectiphy.net/query-builder/joins) as with other types of query.
