---
title: Export Data Modification
description: How to transform or skip exported rows with a PHP script before the export file is written.
---

Use **Data modification** when an export file must follow a partner format that differs from your Shopware data. The script runs for each mapped export row before writing, so the export stays memory efficient even for large files.

## Enable Data Modification

1. Open or create an export profile.
2. Go to **Advanced options**.
3. Enable **Data modification**.
4. Enter your PHP script in the editor.
5. Save the profile and run the export.

## Script Variables

The script can use these variables:

| Variable | Description |
| --- | --- |
| `$row` | The current mapped export row as an array. Change values in this array to change the exported row. |
| `$skipRow` | Set this to `true` to omit the current row from the export file. |

:::caution
Do not replace `$row` with a string, number, or object. Keep `$row` as an array and only change its fields, for example `$row['productNumber']`.
:::

## Example: Change a Product Number

Input value:

```text
"-408200-0096-0100"-DE
```

Script:

```php
<?php
$row['productNumber'] = 'G' . str_replace(['"', '-DE'], '', $row['productNumber']);
```

Exported value:

```text
G-408200-0096-0100
```

## Example: Skip Rows

Use `$skipRow = true` when a row should not be written to the export file.

```php
<?php
if ($row['stock'] <= 0) {
    $skipRow = true;
}
```

## Security Limits

For security reasons, only a limited set of common PHP functions is allowed. File access, includes, `eval`, `exit`, and similar constructs are blocked. If a forbidden function is used, the script is not executed for the row.
