Skip to content

Database table prefix

See the table prefix of your WordPress database, choose another one when you create a site, and know how Avaloi keeps it through copies, restores, and moves.

Every WordPress database table starts with a prefix. The prefix is set in wp-config.php as $table_prefix. Most sites use wp_, so the posts table is wp_posts. Some sites use another prefix, such as site_ or abc9_, so the posts table is site_posts.

Avaloi supports any prefix WordPress accepts: letters, digits, and underscores, up to 40 characters. Capital letters count. WP_ and wp_ are two different prefixes, because the database is case sensitive.

See your prefix

Open a site, then open the Info tab. Table prefix is in the environment details. Select the copy button to copy it. Each environment shows its own value, and a copy of an environment keeps the prefix of its source.

The prefix is also in the API and the MCP tools: database.table_prefix in the environment, and get_site in MCP.

Choose a prefix when you create a site

New sites use wp_ unless you choose another prefix.

  1. Open Sites, then Add site, and choose Install WordPress.
  2. Under Advanced, type the prefix in Table prefix.
  3. Create the site as usual.

The prefix applies to a fresh WordPress site, to WooCommerce, and to a Multisite network. In a network every site table uses it: with the prefix site_, the second site's posts table is site_2_posts.

Avaloi checks the prefix before it uses it. A prefix can only hold letters, digits, and underscores. You cannot change the prefix of an existing site from the dashboard. If you need a different one, create a new site with the prefix you want and move your content there.

What stays the same

Avaloi keeps the prefix wherever your data goes:

  • Staging and multidevs copy the database with its prefix.
  • Clone content and promote copy tables by name, so the prefix of the source and the target must match. They always do, because a copy starts from the source.
  • Backups and restores keep the prefix. If you restore a backup made on a site with a different prefix, Avaloi renames the tables, the user rights, and the roles option so WordPress still works.
  • Search and replace covers every table with your prefix, and every site table in a network.
  • Local development reads your real prefix and writes it into the local wp-config.php. See Develop locally with DDEV.
  • Migrations keep the prefix of your backup. See Migrate a Multisite network or a site with a custom prefix.

Still stuck?

Email [email protected] with your site name and what you tried, or send us a message.