Edit table prefix for new installation (or blueprint)

I think it’s a good idea to have the possibility to manage the table prefix (before installation of wp) or modify it after ?

(Windows version)

I would like this feature for Mac as well since Flywheel provisions by default a custom DB prefix for new sites it would be nice to have local be able to match that versus having to edit wp-config afterwards and renaming tables.

1 Like

I you want it, please vote for this feature request using the Vote button.

I agree that this is an important feature, especially if you are setting up a multisite installation. Once Local has set up a multisite install you cannot change the table prefix in wp-config.php without generating database access errors. This seems to be an issue with WordPress, but it would be a non-issue if Local allowed us to choose a table prefix before it set up the local site.

Thanks everyone for the votes and feedback!

We’ll most likely be implementing the ability to choose the database prefix on new site creation in an upcoming version. I can’t give an ETA but it shouldn’t be too far out.

Adding the ability to change the database prefix on existing sites in Local isn’t a high priority for a few reasons:

  1. You can change the database when you deploy the site. Migration tools handle this very, very easily. Most have a text field where you can change the prefix.
  2. Changing the database prefix does not help for security. Here’s a great article on why: https://www.wordfence.com/blog/2016/12/wordpress-table-prefix/
  3. There are plugins such as https://wordpress.org/plugins/wp-prefix-changer/ that can do it easily. Just make sure you Export the Local site prior so you have a backup in case anything goes wrong.
  4. You can create a site, change the prefix, and then save it as a Blueprint to reuse later.
  5. If you’re importing a site into Local from a zip archive, Local will detect and use the appropriate prefix.

With that said, we’re not completely dismissing the idea. We just have a lot of other things on our plate at the moment! :slight_smile:

I’m trying to gauge if this feature is still important.

Right now, Local does a pretty good job of transforming the prefix as necessary when using Connect. In my experience, I’ve been able to pull a site from one remote environment that has one prefix (ie wp_xxx_ to another environment with a different prefix (wp_yyy_) and haven’t had any issues.

For those of you where this feature is important, can you describe when you feel this pain point, as well as a quick overview of the steps you take to manually fix it?

It sounds like the big, hard technical hurdle is with multisites. Are there other situations where you are having to pay special attention to the table prefix?