WordPress.org

Ready to get started?Download WordPress

Codex

Attention Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

pt-br:Instalando Múltiplos Blogs

Artigo parcialmente traduzido ou que precisa de tradução
Este documento está parcialmente traduzido ou precisa ser traduzido. Toda a tradução é feita por voluntários e você pode ser um deles.
ParticiparArtigos para traduzirFórum de SuporteTodos os Artigos
Artigo ou Seção com explicações avançadas
A seguir, estão explicações ou instruções para usuários avançados, o que pode exigir o conhecimento de termos e ferramentas não comuns a todas as pessoas.
Adicione {{Avançado}} para usar esta caixa.

Contents

Multiple Blogs Through Multiple Installs

If you want multiple blogs using WordPress, you must actually install each separately (that is, as a separate WordPress installation). You can do this whether you have the ability to create multiple databases or are limited to a single database.

Please note in WordPress 3.0 there is now a native ability to create multiple blogs, referred to as a network of sites. This is because the codebase for WordPressMU was merged into core. See Create A Network.

Multiple Databases

You'll need a separate MySQL database for each blog you plan to install. If you have not yet created these, basic instructions are found here.

The wp-config.php file will vary for each installation. The lines to change are:

define('DB_NAME', 'wordpress');     // The name of the database
define('DB_USER', 'username');     // Your MySQL username
define('DB_PASSWORD', 'password'); // ...and password

DB_NAME will be the name of the individual database created for that blog. If you are using different user logins for each database, edit DB_USER and DB_PASSWORD to reflect this, as well.

Upload each wp-config.php file to its specific root/installation directory, and run the installation. See Installing WordPress for more information.

Single Database

As with the multiple databases solution described above, the wp-config.php file will vary for each installation. In this case, however, only a single line will be unique to each blog:

$table_prefix = 'wp_'; // example: 'wp_' or 'b2' or 'mylogin_' 

By default, WordPress assigns the table prefix wp_ to its MySQL database tables, but this prefix can be anything you choose. By using more than one, you create unique identifiers for each blog in your database. For example, let's say you have three blogs to set up, with the names Main, Projects and Test. You want to substitute the prefix wp_ for each blog's wp-config.php:

Main blog:

$table_prefix = 'main_'; 

Projects blog:

$table_prefix = 'projects_'; 

Test blog:

$table_prefix = 'test_'; 

As noted, you may use a prefix of your own making. Those provided here are for example purposes only.

Upload each wp-config.php file to its specific root/installation directory, and run the installation. See Installing WordPress for more information.

Multiple Databases, Same Users

You can use the same userbase with all your blogs on the same domain, by defining the CUSTOM_USER_TABLE and optionally the CUSTOM_USER_META_TABLE constants to point to the same wp_your_blog_usermeta and wp_your_blog_users tables. See Editing wp-config.php/Custom User and Usermeta Tables. You will need the WP-Orphanage plugin to automatically set user roles at all blogs.

Other Resources


PESQUISA DE OPINIÃO: SET/2014
Nós queremos saber: por que você ainda não participa da comunidade brasileira WordPress.org?
Responda a pesquisa anonimamente e ajude-nos a melhorar nossa comunidade RESPONDER AGORA →
A documentação do WordPress em Português do Brasil.
Todas as comunidades lusófonas também são bem-vindas! Adicione {{Codex-pt}} em seus artigos.