---
title: Configuration
date: 2026-06-12T22:25:00+01:00
author: John Henry Donovan
canonical_url: "https://johnhenry.ie/plugins/matrix-block-anchor/docs/getting-started/configuration"
section: Plugins
---
esc

↑↓ to navigate↵ to selectesc to close

Menu On this page 

- [Return to top](#)

Documentation

Documentation

# Configuration

Everything on the plugin's [Settings](https://johnhenry.ie/plugins/matrix-block-anchor/docs/guide/plugin-settings) page can also be managed via PHP in a config file. Set these values in `config/matrix-block-anchor.php` and they take precedence over whatever's set in the control panel.

Start by creating a `config/matrix-block-anchor.php` file. It's multi-environment aware too, so you can have different settings per environment, the same as you would with `general.php`.

```php
return [
    'anchorPrefix' => 'blockIdAnchor',
    'allowCustomAnchors' => false,
    'useLegacySeparator' => false,
];
```

config/matrix-block-anchor.php

You can also pass in environment values using the `App::env` PHP method.

```php
use craft\helpers\App;

return [
    'anchorPrefix' => App::env('BLOCK_ANCHOR_PREFIX'),
    'allowCustomAnchors' =>  App::env('BLOCK_ALLOW_CUSTOM_ANCHORS'),
    'useLegacySeparator' =>  App::env('BLOCK_USE_LEGACY_SEPARATOR'),
];
```

config/matrix-block-anchor.php

Then add these values to your `.env` file

```bash
# Matrix Block Anchor Settings
BLOCK_ANCHOR_PREFIX="blockIdAnchor"
BLOCK_ALLOW_CUSTOM_ANCHORS=1
BLOCK_USE_LEGACY_SEPARATOR=0
```

.env

On this page
