Change table prefix in MU

I'm sure I looked at all options on wordpress.org and most plugins for cause problems with MU. I believe its because changing wp_ messes up all the sub sites prefix that are wp_# ( should have been wp_sub# or something like that). Anyway the my host says I'd have to do this manually via search and replace or individually but I see this in wp_config. /**
* WordPress Database Table prefix.
*
* You can have multiple installations in one database if you give each a unique
* prefix. Only numbers, letters, and underscores please!
*/
$table_prefix = 'wp_';

If I change it will it only affect sub sites so I can then easily change wp_ everywhere later ? What problems may changing tables on a long functioning heavily edited site cause?

  • aecnu

    Greetings Annabelle,

    If I change it will it only affect sub sites so I can then easily change wp_ everywhere later ?

    I believe if you change it now it will take your entire WordPress installation down, but i admit I have never tried this before so I cannot be sure. To change this almost certainly should have been done during the initial configuration and installation.

    What problems may changing tables on a long functioning heavily edited site cause?

    Unknown.

    It is my learned opinion that you should consider using Multi DB plugin to avoid most of the possible issues of this type whereas the database sections for each site are independent of the main site with the exception of globals but are then relative to all sites within the network.

    I any event, to help ease the pain and assist dealing with tables in the database, I offer you to download in what is in my opinion the greatest Database Management software of all time Navicat

    Cheers, Joe

  • ThePath

    Only meeeeeee :wink:

    changing wp_ messes up all the sub sites prefix that are wp_#

    As Joe says and you have found out this will break everything. OK so the"wp_" is the standard table prefix. If you wanted to change it then you would do what you did in wp-config (delete wp-config-sample you dont need it). And like your host says change each tables prefix manually to the new prefix that you put in wp-config. There may be a faster way to do it using SSH access on your server but Im not completely sure on that.

    Anyway Im guessing you are doing this as an extra security measure? But to be honest it shouldnt be necessary.

    You will notice in your DB that the main site has a prefix of wp_ and subsites might look like wp_106_

    There needs to be a way to do this properly for MU if regular blogs can do it long after a site's been running.

    But its easy for a single install as you are only changing a few tables manually to a new prefix like its explained here: http://tdot-blog.com/wordpress/6-simple-steps-to-change-your-table-prefix-in-wordpress

    Also take a look at this plugin for recommendations: http://wordpress.org/extend/plugins/wp-security-scan/

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.