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:Crie uma Rede

WordCamp Rio de Janeiro 2014
WordCamp n.p. é um evento com palestras, trocas de experiências sobre web e claro: o encontro de pessoas que usam o WordPress e adoram! Visite o site do evento para saber mais
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 →
Ajuda ao Usuário WordPress
Referência da Ajuda Contextual - Este artigo é acessado a partir da Ajuda Contextual do WordPress PT-BR.
Procure nosso Fórum Oficial se precisar de mais ajuda sobre este assunto.
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.

Desde a versão 3.0 do WordPress, é possível criar uma rede de sites usando o recurso multisite. Este artigo contém instruções para ajudá-lo a criar uma rede.

Uma rede pode ser muito semelhante a sua própria versão do WordPress.com. Usuários finais de sua rede podem criar seus próprios sites quando quiserem, assim como usuários finais do WordPress.com. Se você não tem nenhuma necessidade de permitir que usuários finais criem seus próprios sites, você pode criar uma rede onde apenas você, o administrador, pode adicionar novos sites.

Uma rede é uma coleção de sites que compartilham uma só instalação do WordPress. Eles também podem compartilhar plugins e temas. Os sites individuais na rede são sites virtuais no sentido de que eles não têm seus próprios diretórios em seu servidor, embora eles têm diretórios separados para envio de mídia dentro da instalação compartilhada, e eles têm tabelas separadas no banco de dados.

Contents


Passo 0: Antes de Começar

Comparado com as instalações normais do WordPress, existem mais considerações a levar em conta para criar uma rede. Você precisa decidir se quer usar sub-domínios ou sub-pastas para sua instalação, e também como você quer maneja-las. Trabalhar com uma rede também tem suas diferentes nuances para instalações de temas e plugins (cada site pode ativar ambos mas instalar nenhum).

Este guia descreve como instalar manualmente uma Rede WordPress em sua instalação atual do WordPress.

Por favor, leia pt-br:Antes de Criar uma Rede antes de continuar.

Passo 1: Prepare seu WordPress

Seu site WordPress precisa ser atualizado quando for criar uma rede. A não ser que seja uma instalação recente e você não tenha nada a perder, por favor faça o backup de seus arquivos e bancos de dados.

Também desative todos os plugins. Você poderá reativa-los novamente após a rede estar criada.

Passo 2: Permitir Multisite

Para ativar o item Instalar Rede no menu, você precisa, antes, definir o multisite no arquivo wp-config.php.

Abra o wp-config.php e adicione a seguinte linha "acima" de onde diz /* Isto é tudo, pode parar de editar! =) */. Se ele não disser isso em lugar nenhum, então adicione a linha em algum lugar acima da primeira linha que comece com require ou include:

define( 'WP_ALLOW_MULTISITE', true );

Você precisará atualizar a página para continuar.

Passo 3: Instalando a Rede

O passo anterior ativa o item "Instalar Rede" no menu "Ferramentas". Clique nesse item para ir para a tela "Criar uma Rede de Sites WordPress".

Tools Network Screen

Para ver um exemplo da tela "Criar uma Rede de Sites WordPress", olhe em Administration > Tools > Network Setup. A tela nem sempre é a mesma. O exemplo mostrado é para uma instalação no localhost, o que restringe as opções disponíveis. estricts the options available.

Endereços dos Sites em sua Rede

Você tem a escolha entre sub-domínios e sub-diretórios, exceto quando as configurações existentes restringem sua escolha.

Você precisa escolher uma das duas. Você poderá reconfigurar suas rede para usar a outra opção após a instalação, apesar do aviso que aparece na tela, mas reconfigura-la pode não ser fácil.

Você só precisa de um DNS curinga para a instalação de sites sob demanda baseados em domínio, apesar do aviso que aparece na tela.

See also Before You Begin.

  • Sub-domains — a domain-based network in which on-demand sites use subdomains
  • Sub-directories — a path-based network in which on-demand sites use paths

Network Details

There are filled in automatically, but you can make changes.

Server Address
The domain of the URL you are using to access your WordPress installation.
Network Title
The title of your network as a whole.
Admin E-mail Address
Your email address as super admin of the network as a whole.

Double-check the details and press the Install button.

Note: The installer may perform a check for wildcard subdomains when you have not configured them yet, or when you do not need them at all. Ignore the warning if it does not apply to your network. See Server Requirements above for information about wildcard subdomains.

Step 4: Enabling the Network

Tools Network Created

To enable your network, follow the instructions on the Create a Network of WordPress Sites screen. The instructions that you see are customized for your installation. They might not be the same as the examples you see here.

Back up your existing wp-config.php and .htaccess files, unless this is a fresh install and you have nothing to lose.

There are three steps:

1. Create a directory for media file uploads
This directory must be writable by the web server, the same as your wp-content directory.
2. Add the specified lines to your wp-config.php file
The extra lines go just after where you added the line in Step 1: Prepare Your WordPress.
3. Add the specified lines to your .htaccess file
If you do not have a .htaccess file, then create it in the same directory as your wp-config.php file.
In some cases you might also have to add Options FollowSymlinks at the start of the file.

After completing these steps, log in again using the link provided. You might have to clear your browser's cache and cookies in order to log in.

Step 5: Network Admin Settings

Network Admin

At the left of your WordPress toolbar, My Sites is now the second item. There, all your sites are listed, with handy fly-out menus, as well as a Network Admin menu item. Under Network Admin you can use the Dashboard item to go to the Network Dashboard screen.

Go to the Settings Screen to configure network options, and the Sites Screen to manage your sites.

For more information, see: Network Admin

? Upgraded and can't find the Network Admin menu?


Things You Need To Know

Here are some additional things you might need to know about advanced administration of the network.

User Access

By design, all users who are added to your network will have subscriber access to all sites on your network. To allocate a different default role for users on individual sites, you must use a plugin, such as Multisite User Management.

The capabilities of the site administrator role are also reduced in a WordPress Network. Site admins cannot install new themes or plugins and cannot edit the profiles of users on their site. Only the Network Admin (aka Super Admin) has the ability to perform these tasks in a WordPress network.

Permalinks

While permalinks will continue to work, the main site (i.e. the first one created) will have an extra entry of blog, making your URLs appear like domain.com/blog/YYYY/MM/POSTNAME.

This is by design, in order to prevent collisions with SubFolder installs. Currently there is no easy way to change it, as doing so prevents WordPress from auto-detecting collisions between your main site and any subsites. This will be addressed, and customizable, in a future version of WordPress.

Also note that the blog prefix is not used for static pages which will be accessible directly under the base address, e.g. domain.com/PAGENAME. If you try to create a static page in the first site with the name of another existing site on the network, the page's permalink will get a suffix (e.g. domain.com/PAGENAME-2). If you create a new site with the slug of an existing static page, the static page will not be reachable anymore. To prevent this, you can add the names of your static pages to the blacklist so that no site with that name can be created.

WordPress Plugins

WordPress Plugins now have additional flexibility, depending upon their implementation across the network. All plugins are installed on the network dashboard's plugin page, and can be activated per-site or for the entire network.

  • Site Specific Plugins: WordPress Plugins to be activated or deactivated by an individual site admin are stored in the plugins directory. You need to enable the Plugins page for individual site administrators from the Network Admin's Settings -> Network Settings menu. Specific site administrators can then toggle optional plugin activation.
  • Network Plugins: WordPress Plugins that are also stored in the plugins directory can be activated across the entire network by the super admin. Once 'Network Activated' plugins will become active in all sites. 'Network Activated' plugins are hidden entirely from per-site plugin lists.
  • Must-Use Plugins: Plugins to be used by all sites on the entire network may also be installed in the mu-plugins directory as single files, or a file to include a subfolder. Any files within a folder will not be read. These files are not activated or deactivated; if they exist, they are used. These plugins are hidden entirely from per-site plugin lists.

WordPress Themes

All themes are installed for the entire network. If you edit the code of one theme, you edit it for all sites using that theme. You can install the plugin WordPress.com Custom CSS to allow each site to tweak their own CSS without affecting anyone else. You can activate themes for the entire network, or edit sites and activate them individually.

By default, WordPress assigns "Twenty Eleven" as the theme for all new sites. This can be customized by adding a line like define('WP_DEFAULT_THEME', 'classic'); to your wp-config.php file, where 'classic' is replaced with the folder name of your theme.

Categories and Tags

Global terms are disabled in WordPress 3.0 by default. You can use the Sitewide Tags WordPress Plugin or other similar Plugins to incorporate global tags on the portal/front page of the site or on specific pages or sites within the network to increase navigation based upon micro-categorized content.

Switching network types

It's possible to switch between domain-based (sub-domain) and path-based (sub-directory) installations of Multisite. If you have had WordPress installed for longer than a month and are attempting to activate the network, you will be told to use Sub-domain sites. This is in order to ensure you don't have conflicts between pages (i.e. example.com/pagename ) and sites (i.e. example.com/sitename ). If you are confident you will not have this issue, then you can change this after you finish the initial setup.

In your wp-config.php file, you'll want to change the define call for SUBDOMAIN_INSTALL:

For a domain-based network (sub-domain install)
define( 'SUBDOMAIN_INSTALL', true );
For a path-based network (sub-directory install)
define( 'SUBDOMAIN_INSTALL', false );

You'll also have to change your .htaccess to the new setup.

Note that per the Settings Requirements you cannot switch from Sub-directory to Sub-domain when running on 127.0.0.1 or localhost. This can potentially cause an endless loop of reauth=1 on your root site due to cookie handling.

Apache Virtual Hosts and Mod Rewrite

To enable mod_rewrite to work within an Apache Virtual host you may need to set some options on the DocumentRoot.

<VirtualHost *:80>
  DocumentRoot /var/www/vhosts/wordpress
  <Directory /var/www/vhosts/wordpress>
    AllowOverride Fileinfo Options
  </Directory>

.htaccess and Mod Rewrite

Unlike Single Site WordPress, which can work with "ugly" Permalinks and thus does not need Mod Rewrite, MultiSite requires its use to format URLs for your subsites. This necessitates the use of an .htaccess file, the format of which will be slightly different if you're using SubFolders or SubDomains. The examples below are the standard .htaccess entries for WordPress SubFolders and SubDomains, when WordPress is installed in the root folder of your website. If you have WordPress in it's own folder, you will need to change the value for RewriteBase appropriately.

As a reminder, these are EXAMPLES and work in most, but not all, installs.

SubFolder Example

# BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]

# uploaded files
RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L]

# add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule  ^[_0-9a-zA-Z-]+/(wp-(content|admin|includes).*) $1 [L]
RewriteRule  ^[_0-9a-zA-Z-]+/(.*\.php)$ $1 [L]
RewriteRule . index.php [L]
# END WordPress

SubDomain Example

# BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]

# uploaded files
RewriteRule ^files/(.+) wp-includes/ms-files.php?file=$1 [L]

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule . index.php [L]
# END WordPress

Issues with old WPMU installs

If you installed Wordpress MU in subfolder/subdirectory (not in root folder on your server via ftp) and you have problem with image library, where thumbnails and images do not show, you may need to manually add in rewrite rules for your file directories as follows:

RewriteRule ^([_0-9a-zA-Z-]+/)?siteN/files/(.+) wp-content/blogs.dir/N/files/$2 [L]

Put those below the normal call for uploaded files.

Network Admin Link Location

The Network Admin Link has moved with each major release of WordPress, as this is still a work in progress. Depending on which version of WordPress you are using, the link can be found in the following locations:

  • 3.0 - A menu called Super Admin
  • 3.1 - On the admin header by "Howdy, YOURNAME."
  • 3.2 - On the admin header, as a drop-down under "Howdy, YOURNAME."
  • 3.3 - On the admin bar, as a drop-down under your "My Sites"

Importing into WordPress Network

When you've created your WordPress Network for importing other sites, you need to look at the Migrating Multiple Blogs into WordPress Multisite article.

Related Articles

Páginas da Ajuda acessada nos Painéis de Administração
VE
PaineisPainel Comentários Painel Discussão Painel Escrita Painel Exportar Painel Ferramentas-Disponíveis Painel Fundo Painel Geral| Painel Importar Painel Início Painel Leitura Painel Links Permanentes Painel Mídia Painel Mídia-Adicionar Nova Painel Menus Painel Meus Sites Painel Páginas-Todas as Páginas Painel Plugins-Instalados Painel Posts-Adicionar Novo Painel Rede Painel Tags Painel Temas Painel Todos os Links Painel Usuários-Seu perfil Painel Widgets
RecursosPublique Isso Resumo Cabeçalhos PersonalizadosCampos Personalizados Formatos de Posts
Rede e MultisiteCrie uma RedeDepurando uma Rede WordPress
DesenvolvimentoAPI WordPress XML-RPC Escrevendo um Plugin Funções e Capacidades Widgets em Temas
OutrosAtalhos de Teclado Glossário Formatando Data e Hora Primeiros Passos com o WordPress Spam em Comentários Usando Links Permanentes Cookies