---
title: "IP anonymization task"
manual: "Scheduler"
version: "14.3"
permalink: "https://docs.typo3.org/permalink/typo3/cms-scheduler:ip-anonymization-task@14.3"
source: "BasicTasks/IpAnonymization.rst"
rendered: "2026-10-13T09:27:44+00:00"
---

# IP anonymization task {#ip-anonymization-task}

The IP Anonymization task can take a more elaborate
configuration which is detailed below.

The task anonymizes the IP addresses to enforce the privacy of the persisted data.

**Table of contents**

-   [Example: Configure additional tables for the "IP Anonymization" task](https://docs.typo3.org/permalink/typo3/cms-scheduler:example-configure-additional-tables-for-the-ip-anonymization-task@14.3)
-   [Migration: Supporting custom tables for "IP Anonymization" tasks for both TYPO3 13 and 14](https://docs.typo3.org/permalink/typo3/cms-scheduler:migration-supporting-custom-tables-for-ip-anonymization-tasks-for-both-typo3-13-and-14@14.3)

## Example: Configure additional tables for the "IP Anonymization" task {#ip-anonymization-task-example}

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

The previous configuration method using
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks'][\TYPO3\CMS\Scheduler\Task\IpAnonymizationTask::class]['options']['tables']
has been deprecated and will be removed in TYPO3 v15.See also: Changelog Deprecation: #107562 - Ip Anonymization Task configuration via $GLOBALS

**packages/my_extension/Configuration/TCA/Overrides/tx_scheduler_ip_anonymization.php**

```php
<?php

use TYPO3\CMS\Scheduler\Task\IpAnonymizationTask;

if (isset($GLOBALS['TCA']['tx_scheduler_task'])) {
    $garbageCollectionTables =& $GLOBALS['TCA']['tx_scheduler_task']['types'][IpAnonymizationTask::class]['taskOptions']['tables'];

    $garbageCollectionTables = array_replace($garbageCollectionTables ?? [], [
        'tx_myextension_my_table' => [
            'dateField' => 'tstamp',
            'ipField' => 'private_ip',
        ],
    ]);
}

```

> [!WARNING]
> If your extension overrides the TCA of the scheduler extension, it **must**
> be loaded **after** [`typo3/cms-scheduler`](https://packagist.org/packages/typo3/cms-scheduler), otherwise the
> configuration might take no effect.
>
> See [Extension loading order](https://docs.typo3.org/m/typo3/reference-coreapi/14.3/en-us/ExtensionArchitecture/BestPractices/ExtensionLoadingOrder.html#extension-loading-order)

This entry configures that the field `private_ip` of table
`tx_myextension_my_table` can be anonymized after a chosen number of days.

The field `tstamp` will be taken into account to determine when the database
record was last changed.

## Migration: Supporting custom tables for "IP Anonymization" tasks for both TYPO3 13 and 14 {#ip-anonymization-task-migration}

If your extension supports both TYPO3 13 (or below) and 14 keep the registration
of additional tables in the extensions [`ext_localconf.php`](https://docs.typo3.org/m/typo3/reference-coreapi/14.3/en-us/ExtensionArchitecture/FileStructure/ExtLocalconf.html#file-extension-ext-localconf-php) until support
for TYPO3 13 is removed:

**packages/my_extension/ext_localconf.php**

```php
<?php

use TYPO3\CMS\Core\Information\Typo3Version;
use TYPO3\CMS\Scheduler\Task\IpAnonymizationTask;

if ((new Typo3Version())->getMajorVersion() < 14) {
    // TODO: Remove once TYPO3 13 support is dropped
    // TYPO3 14 configuration can be found in Configuration/TCA/Overrides/tx_scheduler_ip_anonymization.php
    $garbageCollectionTables =& $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks'][IpAnonymizationTask::class]['options']['tables'];

    $garbageCollectionTables = array_replace($garbageCollectionTables ?? [], [
        'tx_myextension_my_table' => [
            'dateField' => 'tstamp',
            'ipField' => 'private_ip',
        ],
    ]);
}

```
