如何安装和设置WordPress多站点网络

Do you want to set up and install WordPress multisite network? WordPress comes with a built-in capability to create multiple websites using the same WordPress installation.

您是否要设置和安装WordPress多站点网络? WordPress具有内置功能,可以使用相同的WordPress安装创建多个网站。

A WordPress multisite network is used by blogs, schools, and businesses, who need to run separate websites but want to manage them under one dashboard.

博客,学校和企业使用WordPress多站点网络,它们需要运行单独的网站,但希望在一个仪表板下进行管理。

In this article, we will show you how to properly install and setup a WordPress multisite network.

在本文中,我们将向您展示如何正确安装和设置WordPress多站点网络。

How to install and setup WordPress multisite network

Since this is a comprehensive article, we have added the table of contents for easier navigation:

由于这是一篇综合性文章,因此我们添加了目录以便于导航:

WordPress Multisite Basics

WordPress多站点基础

  1. What is WordPress Multisite?什么是WordPress多站点?
  2. Pros of using a WordPress multisite network使用WordPress多站点网络的优点
  3. Cons of using a WordPress multisite network使用WordPress多站点网络的缺点
  4. Who needs a WordPress multisite network?谁需要WordPress多站点网络?

WordPress Multisite Installation and Set up

WordPress多站点安装和设置

  1. Requirements for a WordPress multisite networkWordPress多站点网络的要求
  2. Choosing a domain structure for your multisite network为您的多站点网络选择域结构
  3. Setting up wildcard subdomains设置通配符子域
  4. Enabling WordPress multisite network feature启用WordPress多站点网络功能
  5. Setting up your WordPress multisite network设置WordPress多站点网络

WordPress Multisite Configuration Settings

WordPress多站点配置设置

  1. Configuring network settings配置网络设置
  2. Opening your multisite network for registrations打开您的多站点网络进行注册
  3. New site settings新网站设置
  4. Upload settings for your multisite network上载您的多站点网络的设置
  5. Plugin menu settings插件菜单设置

Setting up Default Content, Theme, and Plugins

设置默认内容,主题和插件

  1. Adding new sites to your WordPress multisite network将新站点添加到您的WordPress多站点网络
  2. Adding themes and plugins to your multisite network将主题和插件添加到您的多站点网络
  3. Adding default Content to new sites将默认内容添加到新站点
  4. Troubleshooting and FAQs

    故障排除和常见问题解答

    1. Troubleshooting WordPress multisite issues对WordPress多站点问题进行故障排除
    2. FAQs about WordPress multisite关于WordPress多站点的常见问题解答
    什么是WordPress多站点网络? (What is WordPress Multisite Network?)

    A WordPress Multisite network allows you to run and manage multiple WordPress sites or blogs from a single WordPress installation.

    一个WordPress 多站点网络允许您运行和管理从单一的WordPress安装多个WordPress网站或博客。

    It enables you to create new sites instantly and manage them using the same username and password. You can even allow other users to signup and create their own blogs on your domain.

    它使您可以立即创建新站点并使用相同的用户名和密码进行管理。 您甚至可以允许其他用户在您的域上注册并创建自己的博客。

    The WordPress multisite network comes with advanced settings that you can use to customize each website / blog on your network.

    WordPress多站点网络具有高级设置,可用于自定义网络上的每个网站/博客。

    Pros of Using a WordPress Multisite Network

    使用WordPress多站点网络的优点

    In many situations, a WordPress multisite network can be more useful than managing multiple standalone WordPress sites. Here are some of the advantages of using a WordPress multisite network:

    在许多情况下,WordPress多站点网络比管理多个独立WordPress网站更有用。 以下是使用WordPress多站点网络的一些优点:

    1. As the network administrator, you can easily manage multiple sites from a single dashboard.

      作为网络管理员,您可以从单个仪表板轻松管理多个站点。
    2. Each site on the network can have its own admins. The site admins will have the capabilities to manage only their own website.

      网络上的每个站点都可以有自己的管理员。 网站管理员将只能管理自己的网站。
    3. You can install plugins / themes and activate them for multiple sites with one download.

      您可以安装插件/主题,并一次下载即可激活多个站点的插件/主题。
    4. Multisite network also makes it easier for you to manage updates. You only need to update your WordPress, plugins, or themes on one “master” install.

      多站点网络还使您更轻松地管理更新。 您只需要在一个“主”安装上更新WordPress,插件或主题。

    Cons of Using a WordPress Multisite Network

    使用WordPress多站点网络的缺点

    Creating a WordPress multisite network is not always helpful in managing multiple sites. Here are some of the disadvantages that you should keep in mind before setting up a multisite network.

    创建WordPress多站点网络并不总是有助于管理多个站点。 在建立多站点网络之前,应牢记以下一些缺点。

    1. All sites on the network share the same resources. This means that when your network is down, all other sites go down as well.

      网络上的所有站点共享相同的资源。 这意味着当您的网络关闭时,所有其他站点也会关闭。
    2. It’s not easy to manage traffic and server resources for the beginner level users. In case, one of your websites gets unexpected traffic, then it will affect all other websites on the network.

      对于初学者来说,管理流量和服务器资源并不容易。 如果您的网站之一收到了意外的流量,那么它将影响网络上的所有其他网站。
    3. If one website gets hacked, then this means all sites on your network will get hacked.

      如果一个网站被黑客入侵,则意味着您网络上的所有网站都将被黑客入侵。
    4. Some WordPress plugins may not work well on a multisite network.

      某些WordPress插件在多站点网络上可能无法正常工作。
    5. WordPress multisite network is not properly supported by all web hosting providers which limits your options. We will talk more about this later in the article.

      并非所有的Web托管提供商都正确支持WordPress多站点网络,这限制了您的选择。 我们将在本文后面详细讨论。
    谁需要WordPress多站点网络? (Who needs a WordPress multisite network?)

    Just because you manage multiple WordPress websites does not mean you need to start using a multisite network.

    仅仅因为您管理多个WordPress网站并不意味着您需要开始使用多站点网络。

    There are third party tools to manage multiple WordPress sites from a single dashboard. Tools like InfiniteWP or iThemes Sync make it easier to maintain multiple WordPress sites under one roof without switching back and forth from one site to another.

    有第三方工具可从单个仪表板管理多个WordPress网站 。 诸如InfiniteWPiThemes Sync之类的工具可以更轻松地在一个屋檐下维护多个WordPress网站,而无需在一个网站之间来回切换。

    Here are some scenarios when creating a multisite network makes sense:

    以下是创建多站点网络有意义的一些方案:

    1. A magazine website with different sections managed by different teams.

      一个由不同团队管理的具有不同部分的杂志网站。
    2. business website with sub-sites for different locations and branches.商业网站 ,其子站点用于不同的位置和分支机构。
    3. Government or non-profit websites can use WordPress multisite for different departments, locations, and regions.

      政府或非营利性网站可以针对不同部门,位置和地区使用WordPress多站点。
    4. Your own network of blogs running on multiple subdomains.

      您自己的博客网络在多个子域上运行。
    5. Schools and colleges allowing students to create their own blogs on school servers.

      学校和学院允许学生在学校服务器上创建自己的博客。
    WordPress多站点网络的要求 (Requirements for a WordPress Multisite Network)

    All websites on a WordPress multisite network share the same server resources. This means that the most important thing you will need is a good WordPress hosting.

    WordPress多站点网络上的所有网站共享相同的服务器资源。 这意味着您将需要的最重要的东西是一个好的WordPress托管

    If you are planning on having just a couple of websites with low traffic, then you can probably get away with shared hosting.

    如果您打算只建立几个流量较低的网站,那么您可以摆脱共享托管

    However, due to the nature of multisite network, you’d need VPS hosting or a dedicated server as your sites grow.

    但是,由于多站点网络的性质,随着站点的增长,您将需要VPS托管或专用服务器。

    We recommend Bluehost because they offer both shared hosting and VPS/Dedicated servers, and they are also one of the official WordPress hosting partners.

    我们推荐Bluehost,因为它们既提供共享托管又提供VPS /专用服务器,并且它们也是WordPress官方托管合作伙伴之一。

    If you’re looking for an alternative, then SiteGround and WP Engine provide excellent service for WordPress multisite network.

    如果您正在寻找替代方案,则SiteGroundWP Engine可为WordPress多站点网络提供出色的服务。

    Apart from web hosting, you will need the basic knowledge of how to install WordPress and editing files using FTP.

    除了虚拟主机,您还需要有关如何安装WordPress使用FTP编辑文件的基本知识。

    为您的多站点网络选择域结构 (Choosing a Domain Structure for your Multisite Network)

    On a WordPress multisite network, you can add new sites using either subdomains or sub-directories.

    在WordPress多站点网络上,您可以使用子域或子目录添加新站点。

    Example of subdomain:
    http://site1.example.com

    子域示例:
    http://site1.example.com

    Example of sub-directory:
    http://example.com/site1/

    子目录示例:
    http://example.com/site1/

    If you choose subdomains, then you will have to configure wildcard subdomains on your server. We will show you how to do that in the next step.

    如果选择子域,则必须在服务器上配置通配符子域。 我们将向您展示下一步的操作。

    On the other hand, if you choose sub-directories or path based URLs for sites on your network, then you can skip the next step.

    另一方面,如果您为网络上的站点选择子目录或基于路径的URL,则可以跳过下一步。

    设置通配符子域 (Setting Up Wildcard Subdomains)

    If you decide to use subdomains for websites on your multisite network, then you will need to setup wildcard subdomains for your multisite network.

    如果您决定对多站点网络上的网站使用子域,则需要为多站点网络设置通配符子域。

    To do that, first you need to login to your WordPress hosting account’s cPanel dashboard. After that, you need to scroll down to the ‘Domains’ section and then click on ‘Subdomains’.

    为此,首先您需要登录到WordPress托管帐户的cPanel仪表板。 之后,您需要向下滚动到“域”部分,然后单击“子域”。

    Setting up wild card subdomains

    Note: Depending on your web hosting service, your cPanel dashboard may look slightly different than the screenshot above. This screenshot is from the cPanel on Bluehost.

    注意:根据您的网络托管服务,您的cPanel仪表板看起来可能与上面的屏幕截图略有不同。 此屏幕快照来自Bluehost上的cPanel。

    On the next page, you need to enter the * sign in the subdomain field and select your main domain from the drop-down menu.

    在下一页上,您需要在子域字段中输入*号,然后从下拉菜单中选择您的主域。

    Adding wildcard subdomain

    Cpanel will automatically detect the document root and will display it in the field below. Now click on the ‘Create’ button to add your wildcard subdomain.

    Cpanel将自动检测文档根目录并将其显示在下面的字段中。 现在,点击“创建”按钮以添加您的通配符子域。

    启用WordPress多站点网络功能 (Enabling WordPress Multisite Network Feature)

    Multisite Network feature comes built-in with each WordPress installation. All you need to do is install and setup WordPress like you normally would. After that, you just need to enable the multisite feature.

    每个WordPress安装都内置了多站点网络功能。 您需要做的就是像平常一样安装和设置WordPress 。 之后,您只需要启用多站点功能。

    You can also enable the multisite feature on any existing WordPress site. Before you enable multisite, don’t forget to create a complete backup of your WordPress site.

    您还可以在任何现有的WordPress网站上启用多站点功能。 在启用多站点之前,请不要忘记为WordPress网站创建完整的备份

    To enable Multisite, connect to your site using a FTP client or cPanel file manager, and open the wp-config.php file for editing.

    要启用多站点,请使用FTP客户端或cPanel文件管理器连接到您的站点,然后打开wp-config.php文件进行编辑。

    You need to add the following code to your wp-config.php file just before the /* That’s all, stop editing! Happy blogging. */ line.

    您需要在/ *之前将以下代码添加到wp-config.php文件中,那就停止编辑! 快乐的博客。 * /行。

    
    /* Multisite */
    define( 'WP_ALLOW_MULTISITE', true );
    
    

    Once you are done, you can save and upload your wp-config.php file back to the server.

    完成后,您可以保存wp-config.php文件并将其上传回服务器。

    This code simply enables the multisite feature on your WordPress site. Once enabled, you will still need to setup the multisite network.

    此代码仅在WordPress网站上启用多站点功能。 启用后,您仍然需要设置多站点网络。

    设置您的WordPress多站点网络 (Setting Up Your WordPress Multisite Network)

    Now that you have successfully enabled the Multisite Network feature on your WordPress site, it is time to set up your network.

    既然您已成功在WordPress网站上启用了“多站点网络”功能,那么现在就该建立网络了。

    If you are setting up a mutlisite network on an existing WordPress website, then you will need to deactivate all plugins on your site.

    如果要在现有的WordPress网站上建立多站点网络,则需要停用站点上的所有插件。

    Simply visit the Plugins » Installed Plugins page and select all plugins. You need to select ‘Deactivate’ from the ‘Bulk Actions’ dropdown menu and then click on the ‘Apply’ button.

    只需访问“ 插件»已安装插件”页面,然后选择所有插件。 您需要从“批量操作”下拉菜单中选择“停用”,然后单击“应用”按钮。

    Deactivate plugins

    You can now head over to Tools » Network Setup page to configure your multisite network.

    现在,您可以转到工具»网络设置页面来配置您的多站点网络。

    WordPress multisite network setup

    On the network setup screen, you will see a notice that you need Apache’s mod_rewrite module installed on your server. This module is installed and enabled on all the best WordPress hosting providers.

    在网络设置屏幕上,您会看到一个通知,您需要在服务器上安装Apache的mod_rewrite模块。 该模块已在所有最佳WordPress托管提供商上安装并启用。

    The next thing you need to do is to tell WordPress what kind of domain structure you will be using for sites in your network, e.g. Subdomains or Sub-directories.

    您需要做的下一件事是告诉WordPress您将在网络中的站点上使用哪种域结构,例如子域或子目录。

    After that, you would need to provide a title for your network and make sure that the email address in the Network admin email is correct.

    之后,您需要为网络提供标题,并确保网络管理员电子邮件中的电子邮件地址正确。

    Click on the install button to continue.

    单击安装按钮继续。

    WordPress will now show you some code that you need to add to your wp-config.php and .htaccess file respectively.

    WordPress现在将向您显示一些代码,分别需要添加到wp-config.php和.htaccess文件中。

    Add code to wp-config and .htaccess files

    You can use an FTP client or file manager in the cPanel to copy and paste the code in these two files.

    您可以在cPanel中使用FTP客户端或文件管理器将代码复制并粘贴到这两个文件中。

    After that you will need to re-login to your WordPress site to access the multisite network.

    之后,您将需要重新登录WordPress网站以访问多站点网络。

    配置网络设置 (Configuring Network Settings)

    Now that you have setup the multisite network, it is time to configure network settings.

    现在,您已经设置了多站点网络,是时候配置网络设置了。

    You need to switch to the ‘Network Dashboard’ to change network settings, add new sites, and configure other settings.

    您需要切换到“网络仪表板”以更改网络设置,添加新站点以及配置其他设置。

    When you take your mouse over to the ‘My Sites’ menu in the admin toolbar, a flydown popup will appear. Click on the Network Admin » Dashboard.

    当您将鼠标移到管理工具栏中的“我的网站”菜单上时,将显示一个弹出窗口。 单击网络管理»仪表板

    Network admin dashboard

    This will take you to the multisite network dashboard. You will notice that there are new menu items to manage your multisite network. You will also see a “Right Now” dashboard widget that allows you to create a new site and add new users.

    这将带您到多站点网络仪表板。 您会注意到,有一些新菜单项可以管理您的多站点网络。 您还将看到“立即使用”信息中心小部件,该控件可让您创建新站点并添加新用户。

    Network dashboard

    To configure network settings, you need to click on the ‘Settings’ link in the admin sidebar.

    要配置网络设置,您需要点击管理侧边栏中的“设置”链接。

    The first option on network settings page is to set your site title and admin email address. These fields will be filled automatically with the network title and admin email you entered during setup.

    网络设置页面上的第一个选项是设置您的网站标题和管理员电子邮件地址。 这些字段将自动用您在设置过程中输入的网络标题和管理员电子邮件填充。

    Network settings

    Opening Your Multisite Network for Registrations

    打开您的多站点网络进行注册

    The ‘Registration Settings’ section on the network settings page is probably the most important setting in your network setup.

    网络设置页面上的“注册设置”部分可能是网络设置中最重要的设置。

    By default, both user and site registrations are disabled on the network.

    默认情况下,用户和站点注册都在网络上被禁用。

    You can choose to open your site for user registration, or allow existing users to create new sites, or allow both user and site registration.

    您可以选择打开站点进行用户注册,或者允许现有用户创建新站点,或者同时允许用户和站点注册。

    WordPress multisite registration settings

    If you are opening your multisite network to registration, then you can check the box next to ‘Registration Notification’ option to receive email notifications every time a new user or site is registered.

    如果要打开多站点网络进行注册,则可以选中“注册通知”选项旁边的框,以在每次注册新用户或新站点时接收电子邮件通知。

    If you want to allow individual site administrators to add new users on their sites, then you can check the box next to ‘Add New Users’ option.

    如果要允许单个站点管理员在其站点上添加新用户,则可以选中“添加新用户”选项旁边的框。

    Registration options

    Limited Email Registration option allows you to limit site or user registration to email addresses from specific domains. This is particularly useful if you only want to allow people from your own organization to register and create users or sites.

    受限电子邮件注册选项使您可以将站点或用户注册限制为来自特定域的电子邮件地址。 如果您只想允许您自己组织中的人员注册和创建用户或站点,则此功能特别有用。

    Similarly, you can also ban certain domains from registration.

    同样,您也可以禁止某些域注册。

    New Site Settings

    新网站设置

    The ‘New Site Settings’ section allows you to configure default options for new sites created on your multisite network.

    “新站点设置”部分允许您为在多站点网络上创建的新站点配置默认选项。

    You can modify the welcome emails and the contents of first default post, page, and comment in these settings.

    您可以在这些设置中修改欢迎电子邮件以及第一默认帖子,页面和评论的内容。

    New site settings

    As a network administrator, you can change these settings anytime.

    作为网络管理员,您可以随时更改这些设置。

    Upload Settings for Your Multisite Network

    多站点网络的上传设置

    It is important for you to keep an eye on the usage of your server resources. Under the Upload Settings section, you can limit the total amount of space a site can use for uploads.

    对您而言,请务必注意服务器资源的使用情况。 在“上传设置”部分下,您可以限制网站可用于上传的总空间量。

    The default value is 100 MB which is probably good for at least 100 photo uploads. You can increase or decrease this space depending on how much disk space you have.

    默认值为100 MB,这可能适合至少上传100张照片。 您可以增加或减少此空间,具体取决于您拥有多少磁盘空间。

    Upload settings

    The default upload file types are images, audio, video, and pdf files. You can add additional file types if you want like doc, docx, odt, etc.

    默认的上传文件类型为图像,音频,视频和pdf文件。 您可以根据需要添加其他文件类型 ,例如doc,docx,odt等。

    After that, you can choose a file size limit, so that users can’t upload insanely large files to the server.

    之后,您可以选择文件大小限制,以使用户无法将超大文件上传到服务器。

    Plugin Menu Settings

    插件菜单设置

    Next, you can jump to the menu settings. It will allow you to enable the administrative menu for the plugins section on your network sites.

    接下来,您可以跳至菜单设置。 它将允许您在网络站点上启用插件部分的管理菜单。

    Show or hide plugins menu to site admins

    Enabling this will show plugins menu to respective site admins. They can activate or deactivate a plugin on their individual sites, but they cannot install new plugins.

    启用此选项将向相应站点管理员显示插件菜单。 他们可以在各自的站点上激活或停用插件,但不能安装新的插件。

    Once you are satisfied with all the configuration settings, make sure to click on the ‘Save Changes’ button.

    对所有配置设置满意后,请确保单击“保存更改”按钮。

    将新站点添加到您的WordPress多站点网络 (Adding New Sites to Your WordPress Multisite Network)

    To add a new site to your WordPress multisite network, simply click on ‘Sites’ under My Sites » Network Admin menu in the admin toolbar.

    要将新站点添加到WordPress多站点网络,只需在管理工具栏中的“ 我的站点”»“网络管理”菜单下单击“站点”。

    Adding new sites to your WordPress multisite network

    This will show you a list of sites on your current multisite installation. By default, you have your primary site listed as the only site in your WordPress multisite network.

    这将向您显示当前多站点安装中的站点列表。 默认情况下,您的主站点被列为WordPress多站点网络中的唯一站点。

    To add a new site, click on the ‘Add New’ button at the top.

    要添加新站点,请单击顶部的“添加新”按钮。

    Add new site

    On the ‘Add New Site’ page, you need to provide the site’s address. You don’t need to type the full address, just the part you want to use as subdomain or sub-directory.

    在“添加新站点”页面上,您需要提供站点的地址。 您不需要键入完整的地址,只需键入要用作子域或子目录的部分。

    Next, you need to add a site title, and enter the site admin’s email address.

    接下来,您需要添加网站标题,然后输入网站管理员的电子邮件地址。

    Adding new site details

    You can add an admin email address other than the one that you are currently using to manage your multisite network.

    您可以添加一个管理员电子邮件地址,而不是当前用于管理多站点网络的管理员电子邮件地址。

    If the email address is not currently in use by another user, then WordPress will create a new user and send the username and password to the email address you enter.

    如果该电子邮件地址当前未被其他用户使用,则WordPress将创建一个新用户,并将用户名和密码发送到您输入的电子邮件地址。

    Once you are done, click on the ‘Add Site’ button.

    完成后,单击“添加站点”按钮。

    A new site will be added to your WordPress multisite network. As the network admin, you will receive a new site registration email as well.

    一个新站点将被添加到您的WordPress多站点网络中。 作为网络管理员,您还将收到新的网站注册电子邮件。

    If you created a new user, then that user will receive an email with instructions to set a new password and login.

    如果您创建了一个新用户,则该用户将收到一封电子邮件,其中包含有关设置新密码和登录名的说明。

    向您的多站点网络添加主题和插件 (Adding Themes and Plugins to Your Multisite Network)

    By default, individual site administrators in a multisite network cannot install themes and plugins on their own.

    默认情况下,多站点网络中的单个站点管理员无法自行安装主题和插件。

    As the network admin, you can install the respective plugins and themes, so it’s available for all sites on your network.

    作为网络管理员,您可以安装相应的插件和主题,因此可用于网络上的所有站点。

    Installing themes for your multisite network

    为您的多站点网络安装主题

    To add themes, go to My Sites » Network Admin » Themes page.

    要添加主题,请转到“ 我的网站”»“网络管理员”»“主题”页面。

    Installed themes on your WordPress multisite network

    On this page, you will see a list of currently installed themes on your WordPress multisite.

    在此页面上,您将在WordPress多站点上看到当前安装的主题的列表。

    You can make a theme available to other sites by clicking on ‘Network Enable’ option under that theme. You can also disable a theme by clicking on ‘Network Disable’ link under the theme. Note: Network Disable option will only appear when the theme is enabled.

    通过单击该主题下的“网络启用”选项,可以使该主题可用于其他站点。 您还可以通过单击主题下的“网络禁用”链接来禁用主题。 注意:仅当启用主题时,“网络禁用”选项才会出现。

    To add a new theme, you need to click on the ‘Add New’ button at the top of your screen and then install a WordPress theme as you would normally do.

    要添加新主题,您需要单击屏幕顶部的“添加新”按钮,然后像通常一样安装WordPress主题

    Once the new theme is installed, you will be able to make it available to other sites on your network with the ‘Network Enable’ option.

    一旦安装了新主题,您就可以通过“网络启用”选项使它可用于网络上的其他站点。

    If you need recommendations on which themes to make available to your network, take a look at our picks of the best WordPress themes that you can use.

    如果您需要有关哪些主题可用于您的网络的建议,请查看我们精选的最佳WordPress主题。

Setting a default theme for your Multisite Network

为您的多站点网络设置默认主题

After you have added a couple of themes, WordPress will still activate the default WordPress theme for each new site.

添加了两个主题后,WordPress仍将为每个新站点激活默认的WordPress主题。

If you want to make another theme to be the default theme for new sites, then you need to add the following code to your wp-config.php file.

如果要将另一个主题作为新站点的默认主题,则需要将以下代码添加到wp-config.php文件中。


// Setting default theme for new sites
define( 'WP_DEFAULT_THEME', 'your-theme' );

Replace your-theme with the name of your theme. You will need to use the name of the theme’s folder, which you can find out by looking at the /wp-content/themes/ folder.

用主题名称替换您的主题。 您将需要使用主题文件夹的名称,可以通过查看/ wp-content / themes /文件夹来找到它。

Installing plugins for your multisite network

为您的多站点网络安装插件

Similarly, you can visit My Sites » Network Admin » Plugins page to install plugins and click on the ‘Network Activate’ link below each plugin to activate them on your multisite network.

同样,您可以访问我的站点»网络管理»插件页面以安装插件 ,然后单击每个插件下方的“网络激活”链接以在多站点网络上激活它们。

Network activate plugins on a WordPress multisite

Following are a few essential WordPress plugins that we recommend for every website:

以下是我们为每个网站推荐的一些基本WordPress插件:

For more plugin recommendations, see our list of the essential WordPress plugins for all websites.

有关更多插件建议,请参阅所有网站的基本WordPress插件列表。

Note: If you have enabled the Plugins Menu option for site admins in the ‘Network Settings’ previously, then the site administrators can activate or deactivate installed plugins on their own. Site admins cannot delete or install a new plugin on their own.

注意:如果您以前在“网络设置”中为站点管理员启用了“插件菜单”选项,则站点管理员可以自行激活或停用已安装的插件。 网站管理员无法自行删除或安装新插件。

将默认内容添加到多站点站点 (Adding Default Content to Multisite Sites)

By default, WordPress allows you to edit some default content for each site on your multisite network. You can go to Settings » Network Settings page and add them under the section ‘New site settings’.

默认情况下,WordPress允许您为多站点网络中的每个站点编辑一些默认内容。 您可以转到设置»网络设置页面,并将其添加到“新站点设置”部分下。

New site defaults

You can edit the content for the default post, page, and comment. We recommend replacing the default content with something more useful for your site admins.

您可以编辑默认帖子,页面和评论的内容。 我们建议使用对您的网站管理员更有用的内容替换默认内容。

What if you wanted additional default content to be added to each new site?

如果希望将其他默认内容添加到每个新站点怎么办?

By default, WordPress does not give you an option to create additional default content for new sites. If you want to do that, then you will need to add custom code to your WordPress multisite.

默认情况下,WordPress不允许您选择为新网站创建其他默认内容。 如果要这样做,则需要向WordPress多站点添加自定义代码

In this example, we are going to add a new default page to be created for each new site.

在此示例中,我们将为每个新站点添加一个新的默认页面。


add_action('wpmu_new_blog', 'wpb_create_my_pages', 10, 2);
 
function wpb_create_my_pages($blog_id, $user_id){
  switch_to_blog($blog_id);
 
// create a new page
  $page_id = wp_insert_post(array(
    'post_title'     => 'About',
    'post_name'      => 'about',
    'post_content'   => 'This is an about page. You can use it to introduce yourself to your readers or you can simply delete it.',
    'post_status'    => 'publish',
    'post_author'    => $user_id, // or "1" (super-admin?)
    'post_type'      => 'page',
    'menu_order'     => 1,
    'comment_status' => 'closed',
    'ping_status'    => 'closed',
 ));
  
restore_current_blog();
}

You can use the same code with little modifications to create default posts for new sites. Check out the following code:

您可以使用相同的代码而无需做任何修改即可为新网站创建默认帖子。 查看以下代码:


add_action('wpmu_new_blog', 'wpb_create_my_pages', 10, 2);
 
function wpb_create_my_pages($blog_id, $user_id){
  switch_to_blog($blog_id);
 
// create a new page
  $page_id = wp_insert_post(array(
    'post_title'     => 'A sample blog post',
    'post_name'      => 'sample-blog-post',
    'post_content'   => 'This is just another sample blog post. Feel free to delete it.',
    'post_status'    => 'publish',
    'post_author'    => $user_id, // or "1" (super-admin?)
    'post_type'      => 'post',
 ));
  
restore_current_blog();
}

WordPress多站点问题故障排除 (Troubleshooting WordPress Multisite Issues)

Most common issues with WordPress multisite network setup occur due to incorrect configuration of wildcard subdomains and domain mapping issues. Make sure that your web host supports wildcard subdomains before setting up multisite.

WordPress多站点网络设置最常见的问题是由于通配符子域的配置不正确和域映射问题引起的。 设置多站点之前,请确保您的Web主机支持通配符子域。

Following are some other common issues and their quick fixes.

以下是一些其他常见问题及其快速修复。

Fixing login issues on multisite installs

解决多站点安装中的登录问题

Another common issue is that when using WordPress multisite with sub-directories, some users are unable to login to the admin area of their sites after they add the required code in wp-config.php file.

另一个常见问题是,当使用带有子目录的WordPress多站点时,某些用户在wp-config.php文件中添加所需的代码后将无法登录其站点的管理区域。

To fix this, try replacing

要解决此问题,请尝试更换


define('SUBDOMAIN_INSTALL', false);

line in wp-config.php file with

wp-config.php文件中的一行


define('SUBDOMAIN_INSTALL', 'false');

Find unconfirmed users

查找未确认的用户

Another issue that you may come across is not being able to find users who registered on your network but didn’t get the activation email. To fix this issue, see our guide on how to find pending unconfirmed users in WordPress.

您可能遇到的另一个问题是无法找到在您的网络上注册但没有收到激活电子邮件的用户。 要解决此问题,请参阅我们的指南, 了解如何在WordPress中查找待处理的未经确认的用户

Exporting a site from multisite to its own WordPress install

将站点从多站点导出到自己的WordPress安装

Later at some point, you or another site owner may want to export a site from multisite to its own WordPress install. This can be easily done. For step by step instructions see our guide on how to move a site from WordPress multisite to single install.

稍后,您或其他站点所有者可能希望将站点从多站点导出到自己的WordPress安装中。 这很容易做到。 有关分步说明的信息,请参阅我们的有关如何将网站从WordPress多网站迁移到单一安装的指南

You may also want to bookmark our ultimate guide of common WordPress errors and how to fix them. It will save you a lot of time by quickly fixing the most common WordPress issues.

您可能还想将我们关于WordPress常见错误的最终指南以及如何解决这些问题添加为书签。 快速修复最常见的WordPress问题,它将为您节省大量时间。

关于WordPress多站点网络的常见问题解答 (FAQs About WordPress Multisite Network)

Many of our users have asked us plenty of questions about WordPress multisite network and how to use it more efficiently. Following are the most frequently asked questions that we have answered.

我们的许多用户已经向我们询问了有关WordPress多站点网络以及如何更有效地使用它的许多问题。 以下是我们回答的最常见问题。

1. Would I be able to better manage my sites with a multisite network?

1.我能否通过多站点网络更好地管理站点?

To be honest, the answer really depends on your usage scenario.

老实说,答案确实取决于您的使用情况。

For example, if your websites are not related to each other, then you would be better off with a multiple site management tool, like InifiteWP.

例如,如果您的网站彼此不相关,那么最好使用InifiteWP之类的多站点管理工具。

If you manage multiple sites for a restaurant chain, university, or online magazine, then WordPress multisite will be more efficient.

如果您为一家餐厅连锁店,大学或在线杂志管理多个站点,那么WordPress多站点将更加高效。

2. Does WordPress multisite make my websites load faster?

2. WordPress多站点能否使我的网站加载更快?

Once again it depends on several factors. Better WordPress hosting with plenty of server resources will allow multisite to be faster but then again with these resources, individual WordPress sites will also run faster.

再次取决于几个因素。 具有大量服务器资源的更好的WordPress托管将使多站点变得更快,但是再次有了这些资源,单个WordPress网站也将运行得更快。

However, on a shared hosting account, traffic spikes will increase memory usage and slow down all websites on the multisite network at the same time. To improve multisite speed, see our guide on WordPress performance and speed optimization.

但是,在共享主机帐户上,流量高峰将同时增加内存使用率和多站点网络上所有网站的速度。 要提高多站点速度,请参阅有关WordPress性能和速度优化的指南。

3. Can I add an online store to a WordPress Multisite Website?

3.我可以将在线商店添加到WordPress多站点网站吗?

Yes, you can add an online store in WordPress multisite network. Most likely, you will be using an eCommerce plugin like WooCommerce for that, which is compatible with WordPress multisite.

是的,您可以在WordPress多站点网络中添加在线商店 。 最有可能的是,您将为此使用诸如WooCommerce之类的电子商务插件,该插件与WordPress多站点兼容。

4. Can I install ‘x plugin’ on my WordPress multisite?

4.我可以在WordPress多站点上安装“ x插件”吗?

Some WordPress plugins may not be compatible with WordPress multisite. Normally, plugin authors mention it on the plugin’s website and you can avoid installing a plugin that may not work on a multisite setup. However, if it is not mentioned, then it is safe to assume that it is multisite compatible.

某些WordPress插件可能与WordPress多站点不兼容。 通常,插件作者会在插件的网站上提及该插件,您可以避免安装可能无法在多站点设置中使用的插件。 但是,如果未提及,则可以安全地假定它是多站点兼容的。

4. How do I share user logins and roles across the multisite network?

4.如何在多站点网络中共享用户登录名和角色?

By default, a user who is registered on one site cannot register or be added to another site on the same network. That’s because they are already registered in the shared WordPress database. However, they don’t have any user role privileges on other sites.

默认情况下,在一个站点上注册的用户无法注册或添加到同一网络上的另一个站点。 那是因为它们已经在共享的WordPress数据库中注册了。 但是,它们在其他站点上没有任何用户角色特权

You can use third-party plugins like WP Multisite User Sync to sync users across the network. However, you need to be careful as you may end up giving someone admin privileges to a site.

您可以使用WP Multisite User Sync之类的第三方插件在网络上同步用户。 但是,您需要小心,因为您最终可能会向某人授予站点管理员权限。

We hope this article helped you learn how to install and setup WordPress multisite network. You may also want to see our step by step WordPress security guide to protect and keep your WordPress multisite secure.

我们希望本文能帮助您学习如何安装和设置WordPress多站点网络。 您可能还希望查看我们的WordPress安全分步指南,以保护和保持WordPress多站点安全。

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

如果您喜欢这篇文章,请订阅我们的YouTube频道 WordPress视频教程。 您也可以在TwitterFacebook上找到我们。

翻译自: https://www.wpbeginner.com/wp-tutorials/how-to-install-and-setup-wordpress-multisite-network/

  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值