Define custom database prefix using bedrock environment?

Hi Guys,

I have just moved way from my previous work flow using YEOPRESS to generate Wordpress installations on the server over to Bedrock using Composer - so far so good!

I noticed after configuring the .env file and running Wordpress installer it defaults to wp_ prefix which I would like to modify for added security.

Is it possible to declare a custom database prefix in the .env file or should this be defined somewhere else?

A hint in the right direction would be appreciated :smile:

If you look in config/application.php, you’ll see:

$table_prefix = getenv('DB_PREFIX') ?: 'wp_';

So define DB_PREFIX in your .env file

DB_PREFIX="abc123_"
3 Likes