Steps
- Go to your project
- Open your environment (e.g.
production) - Click your WordPress service
- On the left sidebar → click Environment Variables
- Switch to Developer view (important)
- Add your keys and then the
WORDPRESS_CONFIG_EXTRAso it should look like this:
KEY_1=XXX
KEY_2=XXX
WORDPRESS_CONFIG_EXTRA=define('KEY_1', getenv('KEY_1')); define('KEY_2', getenv('KEY_2'));
Then save the environement variables and deploy (or restart).
Notes (so you don’t get caught again)
- Use Developer view, not Normal view
- Keep everything single-line (i.e. don’t select Is Multiline?)
- Don’t select Is Literal?
- Don’t wrap anything in quotes
WORDPRESS_CONFIG_EXTRAinjects directly intowp-config.php