Skip to main content
Removed erroneous sentance that got me a downvote, emphasised parts that actually answer the question.
Source Link
ToniWidmo
  • 335
  • 4
  • 22

Method 1: wp-config.php

Wordpress stores data such as the primary uri and the active theme in the database, so what but you are suggesting can't really be done (at least not without hacking one of the wp-config.php files)can get around this by editting the wp-config.php of the second install. This requires that both installations have access to the same database.

$table_prefix1 = 'wp1_';
$table_prefix2 = 'wp2_'; 

$wpdb->posts = $table_prefix1 . 'posts';
$wpdb->users = $table_prefix1 . 'users';
$wpdb->categories = $table_prefix1 . 'categories';
$wpdb->post2cat = $table_prefix1 . 'post2cat';
$wpdb->comments = $table_prefix1 . 'comments';
$wpdb->links = $table_prefix1 . 'links';
$wpdb->linkcategories = $table_prefix1 . 'linkcategories';
$wpdb->options = $table_prefix2 . 'options'; // <-- Note this one uses the other prefix
$wpdb->postmeta = $table_prefix1 . 'postmeta';
$wpdb->usermeta = $table_prefix1 . 'usermeta';

$wpdb->prefix = $table_prefix;

What you canMethod 2: RSS feed reading plugins do

If the two installs are on different servers and for some reason you can't access the same database remotely, asthen a workaround, is have ato get the second wordpress site thatto imports the posts from the first via an RSS feed plugin, such as FeedWordPress.

YouSearch engine considerations

Which ever method you use, you should ensure that the second site is configured NOT to index in search engines, else both sites will suffer in search rankings. If that matters to you.

Wordpress stores data such as the primary uri and the active theme in the database, so what you are suggesting can't really be done (at least not without hacking one of the wp-config.php files).

What you can do, as a workaround, is have a second wordpress site that imports the posts from the first via an RSS feed plugin, such as FeedWordPress.

You should ensure that the second site is configured NOT to index in search engines, else both sites will suffer in search rankings.

Method 1: wp-config.php

Wordpress stores data such as the primary uri and the active theme in the database but you can get around this by editting the wp-config.php of the second install. This requires that both installations have access to the same database.

$table_prefix1 = 'wp1_';
$table_prefix2 = 'wp2_'; 

$wpdb->posts = $table_prefix1 . 'posts';
$wpdb->users = $table_prefix1 . 'users';
$wpdb->categories = $table_prefix1 . 'categories';
$wpdb->post2cat = $table_prefix1 . 'post2cat';
$wpdb->comments = $table_prefix1 . 'comments';
$wpdb->links = $table_prefix1 . 'links';
$wpdb->linkcategories = $table_prefix1 . 'linkcategories';
$wpdb->options = $table_prefix2 . 'options'; // <-- Note this one uses the other prefix
$wpdb->postmeta = $table_prefix1 . 'postmeta';
$wpdb->usermeta = $table_prefix1 . 'usermeta';

$wpdb->prefix = $table_prefix;

Method 2: RSS feed reading plugins

If the two installs are on different servers and for some reason you can't access the same database remotely, then a workaround is have to get the second wordpress site to imports the posts from the first via an RSS feed plugin, such as FeedWordPress.

Search engine considerations

Which ever method you use, you should ensure that the second site is configured NOT to index in search engines, else both sites will suffer in search rankings. If that matters to you.

Source Link
ToniWidmo
  • 335
  • 4
  • 22

Wordpress stores data such as the primary uri and the active theme in the database, so what you are suggesting can't really be done (at least not without hacking one of the wp-config.php files).

What you can do, as a workaround, is have a second wordpress site that imports the posts from the first via an RSS feed plugin, such as FeedWordPress.

You should ensure that the second site is configured NOT to index in search engines, else both sites will suffer in search rankings.