---
title: "ext_tables.php"
manual: "TYPO3 Explained"
version: "13.4"
permalink: "https://docs.typo3.org/permalink/t3coreapi:ext-tables-php@13.4"
source: "ExtensionArchitecture/FileStructure/ExtTables.rst"
rendered: "2026-09-28T12:45:33+00:00"
---

# `ext_tables.php` {#ext-tables-php}

-   **ext_tables.php**

    -   *Scope:* extension
    -   *Path (Composer):* packages/my_extension/ext_tables.php
    -   *Path (Classic):* typo3conf/ext/my_extension/ext_tables.php

    `ext_tables.php` is *not* always included in the global scope of the
    frontend context.

    This file is only included when

    -   a TYPO3 Backend or CLI request is happening
    -   or the TYPO3 Frontend is called and a valid backend user is authenticated

    This file usually gets included later within the request and after TCA
    information is loaded, and a backend user is authenticated.

    > [!TIP]
    > **Hint**
    >
    > In many cases, the file `ext_tables.php` is no longer needed,
    > since `TCA` definitions must be placed in files located at
    > [Configuration/TCA/](https://docs.typo3.org/permalink/t3coreapi:extension-configuration-tca@13.4).

## ext_tables.php must not be used for {#ext-tables-php-not-use}

The [`ext_tables.php`](#file-extension-ext-tables-php) **must not be used** for the following settings:

-   TCA configurations for new tables.
    They should go in [Configuration/TCA/sometable.php](https://docs.typo3.org/permalink/t3coreapi:extension-configuration-tca@13.4).
-   TCA overrides of existing tables. They should go in
    [Configuration/TCA/Overrides/somefile.php](https://docs.typo3.org/permalink/t3coreapi:extension-configuration-tca-overrides@13.4).
-   calling `ExtensionManagementUtility::addToInsertRecords()`
    as this might break the frontend. They should go in
    [Configuration/TCA/Overrides/somefile.php](https://docs.typo3.org/permalink/t3coreapi:extension-configuration-tca-overrides@13.4).
-   calling `ExtensionManagementUtility::addStaticFile()`
    as this might break the frontend. They should go in
    [`Configuration/TCA/Overrides/sys_template.php`](Configuration/TCA/Index.md#file-extension-configuration-tca-overridessomefile-php)

You can use the [Check TCA in ext_tables.php](https://docs.typo3.org/permalink/t3coreapi:admin-tools-upgrade-tca-ext-tables@13.4) tool to find extensions
with [`ext_tables.php`](#file-extension-ext-tables-php) files that change the TCA.

## ext_tables.php should be used for {#ext-tables-php-usage}

These are typical functions that should be in [`ext_tables.php`](#file-extension-ext-tables-php):

-   Registering scheduler tasks:
    [Registering a scheduler task](https://docs.typo3.org/permalink/t3coreapi:extension-configuration-files-scheduler@13.4)
-   Registration of [custom page types](https://docs.typo3.org/permalink/t3coreapi:page-types-example@13.4)
-   Extending [Backend user settings](https://docs.typo3.org/permalink/t3coreapi:user-settings-extending@13.4)

Before you use a utility method in [`ext_tables.php`](#file-extension-ext-tables-php), refer to the method's
PHP doc comment. Unless it explicitly states that you can use the method in context
of [`ext_tables.php`](#file-extension-ext-tables-php) they should not be used here.

## Examples {#ext-tables-php-examples}

Put the following in a file called [`ext_tables.php`](#file-extension-ext-tables-php) in the main directory
of your extension. The file does not need to be registered but will be loaded
automatically:

**EXT:site_package/ext_tables.php**

```php
<?php

declare(strict_types=1);

use MyVendor\MyExtension\Backend\MyClass;

defined('TYPO3') or die();

// Add your code here
MyClass::doSomething();

```

Read [why the check for the TYPO3 constant is necessary](https://docs.typo3.org/permalink/t3coreapi:globals-constants-typo3@13.4).

### Registering a scheduler task {#extension-configuration-files-scheduler}

Scheduler tasks get registered in [`ext_tables.php`](#file-extension-ext-tables-php) as well. Note that the system extension "scheduler" has
to be installed for this to work.

**EXT:site_package/ext_tables.php**

```php
<?php

declare(strict_types=1);

use TYPO3\CMS\Scheduler\Task\CachingFrameworkGarbageCollectionAdditionalFieldProvider;
use TYPO3\CMS\Scheduler\Task\CachingFrameworkGarbageCollectionTask;

defined('TYPO3') or die();

$lll = 'LLL:EXT:my_extension/Resources/Private/Language/locallang.xlf:';

// Add caching framework garbage collection task
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks']
        [CachingFrameworkGarbageCollectionTask::class] = [
          'extension' => 'my_extension',
          'title' => $lll . 'cachingFrameworkGarbageCollection.name',
          'description' => $lll . 'cachingFrameworkGarbageCollection.description',
          'additionalFields' =>
              CachingFrameworkGarbageCollectionAdditionalFieldProvider::class,
        ];

```

### Registering a backend module {#extension-configuration-files-backend-module}

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

The method
\use TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerModule()
has been removed. Register modules in
Extension folder Configuration/Backend.

### Allowing a tables records to be added to Standard pages {#extension-configuration-files-allow-table-standard}

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

The method ExtensionManagementUtility::allowTableOnStandardPages()
has been removed. Use the TCA ctrl option
ignorePageTypeRestriction
instead.
