Rename WordPress’ Database Prefix with WP-CLI

I wanted to update the database prefix one this site, but most of the tutorials out there have you do it manually. There are some plugins available, but I didn’t trust most of them, and the ones that I did were kind of bloated with other features, and I didn’t want to mess with the cleanup, etc.

So, I wrote a WP-CLI command to do it instead.

Install: wp package install iandunn/wp-cli-rename-db-prefix
Use: wp rename-db-prefix new_prefix_


One thought on “Rename WordPress’ Database Prefix with WP-CLI

  1. Hello Ian,

    Just like to thank you for creating that package. I did install it yesterday and it worked wonderfully, thank you for your work on this.


Leave a Reply

Your email address will not be published. Required fields are marked *