三个wordpress站点共享相同的数据



我有多个域名,如:www.site1.com, www.site2.com, www.site3.com

我希望他们都共享相同的DB表除了WP_OPTIONS表。这是因为每个网站将作为"独立"的实体,但仍然有相同的页面,帖子,产品等。

我真的不明白为什么你需要这种功能,这将是糟糕的SEO:)

然而,有几个插件可以让你将帖子分散到Wordpress网络安装中。

DiamondMultisite允许你在wordpress多站点安装的所有博客中发布帖子,我猜它适用于页面

还有ThreeWP Broadcast,它支持更多的内容,似乎也更活跃。

您可以在每次安装中配置使用的DB表名:http://wordpress.org/support/topic/share-certain-parts-of-a-wp-database-over-2-domains

引用自链接站点:

Edit the wp-db.php file in the wp-includes directory.
In the function set_prefix($prefix) section
After :
foreach ( $this->tables as $table )
$this->$table = $this->prefix . $table;
Added :
$this->options = 'wp_' . 'options';

更多表:

$this->posts = 'wp_' . 'posts';
$this->categories = 'wp_' . 'categories';
$this->options = 'wp2_' . 'options';
$this->links = 'wp2_' . 'links';
$this->postmeta = 'wp_' . 'postmeta';
$this->terms = 'wp_' . 'terms';
$this->term_taxonomy = 'wp_' . 'term_taxonomy';
$this->term_relationships = 'wp_' . 'term_relationships';

缺点:这个文件很容易在WordPress更新时被覆盖。

附加说明:我同意x4vier的观点,SEO结果会很糟糕。我不推荐整个概念

最新更新