Title: Multiple sites/themes using the same WP database?
Last modified: August 18, 2016

---

# Multiple sites/themes using the same WP database?

 *  [smk2004](https://wordpress.org/support/users/smk2004/)
 * (@smk2004)
 * [19 years, 5 months ago](https://wordpress.org/support/topic/multiple-sitesthemes-using-the-same-wp-database/)
 * Is it possible to use the same WP database but have mulitiple sites with different
   sets of links and pages to each? If so, how would I set this up?

Viewing 15 replies - 1 through 15 (of 15 total)

 *  [Jon Bourne](https://wordpress.org/support/users/akbigdog/)
 * (@akbigdog)
 * [19 years, 5 months ago](https://wordpress.org/support/topic/multiple-sitesthemes-using-the-same-wp-database/#post-492771)
 * Yeah, that’s precisely what the DB table prefix is for.
 * During the DB configuration part of installation, specify the DB connection information
   for your current WP installation’s database. Then, change the field labeled table
   prefix or database prefix (can’t remember exactly what it’s called) to something
   other than the default “wp_” which is probably already being used by your existing
   WordPress install.
 * This will install the new WP installation’s tables into the same DB with a different
   prefix before the table name, ie. newprefix_posts instead of wp_posts.
 *  [h8dk97](https://wordpress.org/support/users/h8dk97/)
 * (@h8dk97)
 * [19 years, 5 months ago](https://wordpress.org/support/topic/multiple-sitesthemes-using-the-same-wp-database/#post-492772)
 * I’ve also been thinking about this setup. But can you use the same tables for
   different installations? For example if you want to share users between two sites.
 *  [Chris_K](https://wordpress.org/support/users/handysolo/)
 * (@handysolo)
 * [19 years, 5 months ago](https://wordpress.org/support/topic/multiple-sitesthemes-using-the-same-wp-database/#post-492773)
 * Not right out of the box, nope. The two installs would be completely seperate.
 * Search here in the forums for some hacks or related discussions on sharing users.
   It comes up every now and then, but I can’t recall any specifics.
 *  [Jon Bourne](https://wordpress.org/support/users/akbigdog/)
 * (@akbigdog)
 * [19 years, 5 months ago](https://wordpress.org/support/topic/multiple-sitesthemes-using-the-same-wp-database/#post-492775)
 * If all you’re wanting to do is have the same users on all your blogs, install
   your WP installations on the same DB as I explained above. Then, in `wp-settings.
   php`, search for `$wpdb->users` and `$wpdb->usermeta`. Replace the `$table_prefix`
   variable with the table prefix of the users table prefix of the blog with your
   users. It will probably be `wp_` unless you changed it in your initial installation.
 *  Thread Starter [smk2004](https://wordpress.org/support/users/smk2004/)
 * (@smk2004)
 * [19 years, 5 months ago](https://wordpress.org/support/topic/multiple-sitesthemes-using-the-same-wp-database/#post-492776)
 * Thanks akbigdog — but how would I begin to change this if the installation has
   already taken place? Where do I go to make these changes, in my PHP admin?
 *  [h8dk97](https://wordpress.org/support/users/h8dk97/)
 * (@h8dk97)
 * [19 years, 5 months ago](https://wordpress.org/support/topic/multiple-sitesthemes-using-the-same-wp-database/#post-492777)
 * You would have to edit the file wp-settings.php in a text editor i.e. vi and 
   make those changes. Seems easy enough I just hope that will work. Thanks All 
   for your help.
 *  [Jon Bourne](https://wordpress.org/support/users/akbigdog/)
 * (@akbigdog)
 * [19 years, 5 months ago](https://wordpress.org/support/topic/multiple-sitesthemes-using-the-same-wp-database/#post-492778)
 * The methods I described in my two posts above are contingent on installing the
   two blogs on the same database. What you suggest becomes very complicated very
   quickly if they are not installed using the same database.
 *  [noxdineen](https://wordpress.org/support/users/noxdineen/)
 * (@noxdineen)
 * [19 years, 4 months ago](https://wordpress.org/support/topic/multiple-sitesthemes-using-the-same-wp-database/#post-493228)
 * Okay, I have WordPress 2.1, and my wp-settings file has the following line:
 * `$wpdb->users = $wpdb->prefix . 'users';`
 * I don’t see `$table_prefix`. Admittedly, I’m a PHP noob, so I may be missing 
   something.
 *  [linuss](https://wordpress.org/support/users/linuss/)
 * (@linuss)
 * [19 years, 4 months ago](https://wordpress.org/support/topic/multiple-sitesthemes-using-the-same-wp-database/#post-493229)
 * $table_prefix is not used any more $wpdb->prefix is the same thing just the new
   way of getting this information.
 * So replace $wpdb->prefix with the prefix you used in your other blog. example:
   `
   $wpdb->users = 'wp_' . 'users';` If you used the default wp_ in your first blog.
 *  [stuboo](https://wordpress.org/support/users/stuboo/)
 * (@stuboo)
 * [19 years ago](https://wordpress.org/support/topic/multiple-sitesthemes-using-the-same-wp-database/#post-493255)
 * I’d like to do something similar, but instead of sharing users, I only want to
   share posts.
 * Ultimately, I want each site to have its own theme, options, users, etc. but 
   I want all sites to share the same posts.
 * Thanks,
    Ryan
 *  [moshu](https://wordpress.org/support/users/moshu/)
 * (@moshu)
 * [19 years ago](https://wordpress.org/support/topic/multiple-sitesthemes-using-the-same-wp-database/#post-493256)
 * Well, that would be duplicate content and the search engines wouldn’t like it.
   
   You will have to ask about it in a ‘splog support’ forum 🙂
 *  [stuboo](https://wordpress.org/support/users/stuboo/)
 * (@stuboo)
 * [19 years ago](https://wordpress.org/support/topic/multiple-sitesthemes-using-the-same-wp-database/#post-493257)
 * [@moshu](https://wordpress.org/support/users/moshu/): Luckily, I’m not producing
   content for search engines. I’m producing it for clients – and it’s not for spamming
   purposes. Consider using wordpress for something like this – [http://rrnewkirk.com/donorweb.html](http://rrnewkirk.com/donorweb.html)(
   this company writes content for multiple clients who, in turn, deliver it to 
   their respective constituents). 🙂
 * I think I found the answer to my own question thanks to akbigdog’s comments above.
   I would like some confirmation though…
 * `$wpdb->posts = $wpdb->prefix . 'posts';`
 * should be changed to
 * `$wpdb->posts = 'newprefix_' . 'posts';`
 * in wp-settings.php for each individual wp install.
 * Is this correct?
 *  [DE](https://wordpress.org/support/users/de/)
 * (@de)
 * [19 years ago](https://wordpress.org/support/topic/multiple-sitesthemes-using-the-same-wp-database/#post-493260)
 * Seems I want to do the same thing. One database with multiple sites pulling content
   from it. I was thinking of giving multiple categories to my posts, depending 
   on what site needs to display the news. Did you guys pull this off? Was it easy?
 * I’d like to know if I should use WordPress for this. Been looking for a long 
   time now to find the correct tool to do this.
 * Many thanx,
 * DE
 *  [stuboo](https://wordpress.org/support/users/stuboo/)
 * (@stuboo)
 * [19 years ago](https://wordpress.org/support/topic/multiple-sitesthemes-using-the-same-wp-database/#post-493261)
 * Actually, it was pretty easy DE. You just have to change your table prefixes 
   in the wp-settings.php file like I mentioned above.
 * I’ve not yet tried using different categories for different sites but I know 
   it will work. You’ll just have to force your templates from each of the sites
   to read only posts in specific categories.
 * Hope this helps.
    Ryan
 *  [DE](https://wordpress.org/support/users/de/)
 * (@de)
 * [19 years ago](https://wordpress.org/support/topic/multiple-sitesthemes-using-the-same-wp-database/#post-493262)
 * Thanx Ryan.
 * I’ll give WordPress a try then ^_^

Viewing 15 replies - 1 through 15 (of 15 total)

The topic ‘Multiple sites/themes using the same WP database?’ is closed to new replies.

## Tags

 * [multisites](https://wordpress.org/support/topic-tag/multisites/)
 * [Sites](https://wordpress.org/support/topic-tag/sites/)

 * 15 replies
 * 9 participants
 * Last reply from: [DE](https://wordpress.org/support/users/de/)
 * Last activity: [19 years ago](https://wordpress.org/support/topic/multiple-sitesthemes-using-the-same-wp-database/#post-493262)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
