---
title: "CLI command"
manual: "Recycler"
version: "13.4"
permalink: "https://docs.typo3.org/permalink/typo3/cms-recycler:cli-commands@13.4"
source: "Configuration/CliCommands.rst"
rendered: "2026-10-03T08:24:36+00:00"
---

# CLI command {#cli-commands}

Target group: **Integrators**

A [console command](https://docs.typo3.org/m/typo3/reference-coreapi/13.4/en-us/ApiOverview/CommandControllers/Index.html#symfony-console-commands) is provided by the
[lowlevel](https://docs.typo3.org/c/typo3/cms-lowlevel/13.4/en-us/Index.html) system extension. It
permanently deletes records from the database. Options can be added to the
command as below.

The command can be executed on the console:

**Composer-based installation**

```bash
# Remove all deleted records
vendor/bin/typo3 cleanup:deletedrecords
```

**Legacy installation**

```bash
# Remove all deleted records
typo3/sysext/core/bin/typo3 cleanup:deletedrecords
```

It provides the following options:

-   **--depth**

    -   *Shortcut:* -d
    -   *Type:* integer
    -   *Default:* `1000`

    Sets the traversal depth. `0` (zero) will only analyze the start page (see
    [--pid](https://docs.typo3.org/permalink/typo3/cms-recycler:console-command-option-pid@13.4)), `1` will traverse one level of
    subpages, etc.

    **Example**

    **Composer-based installation**

    ```bash
    # Remove all deleted records, starting from the page tree root
    # with a maximum level of 3
    vendor/bin/typo3 cleanup:deletedrecords --depth=3
    vendor/bin/typo3 cleanup:deletedrecords -d=3
    ```

    **Legacy installation**

    ```bash
    # Remove all deleted records, starting from the page tree root
    # with a maximum level of 3
    typo3/sysext/core/bin/typo3 cleanup:deletedrecords --depth=3
    typo3/sysext/core/bin/typo3 cleanup:deletedrecords -d=3
    ```

-   **--dry-run**

    -   *Default:* `null`

    If this option is set the records will not actually be deleted but records
    which would be deleted are shown.

    **Example**

    **Composer-based installation**

    ```bash
    vendor/bin/typo3 cleanup:deletedrecords --dry-run
    ```

    **Legacy installation**

    ```bash
    typo3/sysext/core/bin/typo3 cleanup:deletedrecords --dry-run
    ```

-   **--min-age**

    <!-- TODO: no Markdown rendering for "versionadded" -->

    -   *Shortcut:* -m
    -   *Type:* integer
    -   *Default:* `0`

    The minimum age in days records need to be marked for deletion before
    actually removing them.

    **Example**

    **Composer-based installation**

    ```bash
    # Remove all deleted records older than 90 days
    vendor/bin/typo3 cleanup:deletedrecords --min-age=90
    vendor/bin/typo3 cleanup:deletedrecords -m=90
    ```

    **Legacy installation**

    ```bash
    # Remove all deleted records older than 90 days
    typo3/sysext/core/bin/typo3 cleanup:deletedrecords --min-age=90
    typo3/sysext/core/bin/typo3 cleanup:deletedrecords -m=90
    ```

-   **--pid**

    -   *Shortcut:* -p
    -   *Type:* integer
    -   *Default:* `0` (page tree root)

    Sets the start page in the page tree.

    **Example**

    **Composer-based installation**

    ```bash
    # Remove all deleted records from the page with UID 42
    vendor/bin/typo3 cleanup:deletedrecords --pid=42
    vendor/bin/typo3 cleanup:deletedrecords -p=42
    ```

    **Legacy installation**

    ```bash
    # Remove all deleted records from the page with UID 42
    typo3/sysext/core/bin/typo3 cleanup:deletedrecords --pid=42
    typo3/sysext/core/bin/typo3 cleanup:deletedrecords -p=42
    ```

> [!NOTE]
> **See also**
>
> [Scheduler task](https://docs.typo3.org/permalink/typo3/cms-recycler:scheduler-tasks@13.4)
