0

I am doing research about wordpress and there are many interesting stuff to learn, i browse the wordpress forum and i found a post about duplicating site.. or multisite.. I am not sure exactly how it work, thats why i wanted to ask you how to do this. Is it possible to have 2 domain name *not subdomain, sharing the same database?.. and when we do a post in one of the site can the other site will be updated? I mean its like auto update because it share the same database right.

I found this code but i dont really know how it work,

// Table names
$wpdb->posts = $table_prefix . 'posts';
$wpdb->users = $table_prefix . 'users';
$wpdb->categories = $table_prefix . 'categories';
$wpdb->post2cat = $table_prefix . 'post2cat';
$wpdb->comments = $table_prefix . 'comments';
$wpdb->links = $table_prefix . 'links';
$wpdb->linkcategories = $table_prefix . 'linkcategories';
$wpdb->options = 'YOURNEWPREFIX_options';
$wpdb->postmeta = $table_prefix . 'postmeta';
$wpdb->usermeta = $table_prefix . 'usermeta';

$wpdb->prefix = $table_prefix;

will this code duplicate the post that the other website do?.. Is this code working? and can anyone explain it to me, Thank you

  • For changing domains you can check this – Sisir Dec 24 '14 at 5:20
  • In the code above it looks like the different site is using the same database but one thing is that each of them have a different options table. The YOURNEWPREFIX_optionsin the above code separates the different options table for different sites. – Karun Dec 24 '14 at 5:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.