# content

Set how Kirby handles content

****

****

## Content file extension

Set the extension you want to use for your content files.

Possible values: `txt`| `md` (default: `txt`)

```php
return [
  'content' => [
    'extension' => 'md'
  ]
];
```

## Ignore files/folders

Set an array of file/folder names that are not scanned by Kirby's core.

```php
return [
  'content' => [
    'ignore' => []
  ]
];
```

## Content locking

Deactivate the content locking mechanism used by the Panel to prevent concurrent edits to a page, file or user:

```php
return [
  'content' => [
    'locking' => false
  ]
];
```

## Salt for drafts and media files

URLs of page drafts and media files contain a hashed token that should be hard to guess. Generating the token requires a salt string that should be stable and consistent on the server, but still independent from other sites or setups and ideally private. The salt is set to the filesystem path of the content root by default (which can sometimes be guessed), so you should define your own salt that will be used instead:

```php
return [
  'content' => [
    'salt' => '...'
  ]
];
```

<info>
The content salt should be a long string of random characters.
</info>

You can also dynamically generate a salt based on the model that needs a token:

```php
return [
  'content' => [
    'salt' => function ($model) {
      return '...';
    }
  ]
];
```

<since v="5.0.0">
When generating a salt for preview authentication tokens of drafts and versions, the closure will not receive as model as argument as those tokens are only based on the URI. The salt callback instead receives `null`  and is expected to return a fixed model-independent salt in this case. When generating a salt for a file media token, the file object is still passed as model.
</since>

You can read more about the security impact of this option in the <a href="https://getkirby.com/docs/guide/security#set-secure-random-values-for-the-content-salt-and-cookie-key">security guide</a>.

## UUID generation

Kirby generates a <a href="https://getkirby.com/docs/guide/uuids">unique alpha-numerical ID</a> for each new page and file by default.

If you prefer the standard UUID v4 format, you can configure Kirby to generate those instead:

```php
return [
  'content' => [
    'uuid' => 'uuid-v4'
  ]
];
```

<info>
Please note that this setting only takes effect for newly generated UUIDs. Existing UUIDs stay unchanged to preserve references throughout your site.
</info>

If you don't need UUIDs in your projects, you can disable them entirely:

```php
return [
  'content' => [
    'uuid' => false
  ]
];
```

## Access to file originals by URL

Uploaded files can be accessed with URLs of the form `https://example.com/some/page/file.pdf` or `https://example.com/some-site-file.pdf`. This can be useful to share clean links to files that keep working even if the media URL changes, e.g. when moving the site to a different server.

Depending on the nature of your files, you can control this behavior either globally or dynamically per file by setting the `content.fileRedirects` option.

Possible values: `true`| `false` | `Closure` (default: `false`)

```php
return [
  'content' => [
    'fileRedirects' => true
  ]
];
```

<alert>
Setting the option to `true` allows all visitors to download the uploaded file originals in full quality and resolution and with all metadata that the file carries. This can be a copyright, privacy or information security concern. Only set the option to `true` if none of your files require access protection.
</alert>

You can also dynamically control this behavior, e.g. based on a file field or other custom logic:

```php
return [
  'content' => [
    'fileRedirects' => fn (File $file): bool => $file->public()->toBool()
  ]
];
```