• I’ve been working on improving the security of my existing 4-blog multi-site WP install. One of the things I attempted to do was change the database table prefix from the standard “wp_” to something more obscure. I followed the directions for this in both John Hoff’s “WordPress Defender” ebook and in the excellent “Digging into WordPress”, which are for standard, not multi-site, installs. I tried:

    1. The WordPress Table Prefix Rename Plugin.

    2. Downloading my database, doing a full search and replace for “wp_”, and replacing my old database with this new one.

    Neither method worked. The plugin method fatally broke all but the main site, while the second method introduced a variety of problems that awkwardly displayed bare naked code (instead of menus and other elements) here and there on all my sites. I assume the problem is that some instances of “wp_” WITHIN the tables need to be changed (as well as the table names) — but not all. But I have no idea which need to be changed and which don’t.

    Does anyone know how to change the database table prefix in an existing multi-site install? Is there a walk-through somewhere that lays out what needs to be done (and not done)? This seems like a good security precaution (wish I’d know about it when I set up the site), but I can’t find any help for accomplishing it on a multi-site install. Any guidance would be most appreciated.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Advisor and Activist

    I would think that option 2 would work fine, provided you also remembered to change the prefix in the wp-config.php file.

    I don’t think that level of change will affect you, though, since if someone’s able to send direct queries at your database, either they’ll leverage the fact that WP has the prefix available (otherwise how does it know where to go) OR they already have admin access to your server, and you’re screwed anyway.

    I’m not a fan of security through obscurity.

    Thread Starter tintypes

    (@tintypes)

    I’d prefer, in this thread anyway, that we avoid discussing the pros and cons of security through obscurity. I’ve seen lots of discussion on this — so let’s assume I want to do it anyway.

    Unfortunately, as I mentioned, option 2 does not work — not flawlessly, anyway. I my experience, option 2 has resulted in partially broken sites. There are, apparently, some instances of “wp_” in the database that should not be changed. Probably names of some plugins, for example. Possibly other instances. Problem is, I don’t know which instances should not be changed — when I look in the tables, there are quite a few that look debatable to me. I’m looking for some help in determining exactly where “wp_” should be changed, and where it shouldn’t. Or at least, I think that is the problem.

    I know for certain multisite support different db prefixes, as I use this on my test install.

    Likely the prefixes you;re having issues with are plguin related. there are too many that use the wrong method to make the prefix.

    DB diagram here:
    http://codex.wordpress.org/Database_Description

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Advisor and Activist

    There are, apparently, some instances of “wp_” in the database that should not be changed.

    Not from a clean install. I just buggered my test install, changing wp_ to foobar_ (no, really) and it worked fine. But. I have no plugins running on this site.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Change Database Table Prefix – Possible on WPMS?’ is closed to new replies.