WordPress Multisite 101 3 Edition

December 19, 2016 | Author: cladic4366 | Category: N/A
Share Embed Donate


Short Description

Download WordPress Multisite 101 3 Edition...

Description

WordPress Multisite 101 How to create a network without tearing out your hair.

Mika Epstein & Andrea Rennick

3rd Edition

Table of Contents Copyright ......................................................................................6 Acknowledgements .......................................................................8 Introduction .................................................................................9 What Is Multisite? ......................................................................11 When You Install WordPress... ...................................................13 Before You Activate Multisite .....................................................15 Creating A Network ...................................................................18 Allow Multisite ....................................................................................................18 Enabling the Network .........................................................................................19

Basic Configuration Options ......................................................22 Operational Settings ...........................................................................................23 New Site Settings ................................................................................................24 Upload Settings ...................................................................................................25

Managing Sites ...........................................................................26 Add New Site ......................................................................................................26 Listing Sites .........................................................................................................27 Editing, Deleting and Archiving Sites .................................................................27

Managing Users .........................................................................30 How to add new users to the network .................................................................30 How to add new users to a site ............................................................................31

How to add existing users to a site ......................................................................32 How to add users to all sites ................................................................................33 How to make a new Super Admin ......................................................................33

Managing Plugins .......................................................................35 Installing Plugins .................................................................................................35 Activating Plugins ...............................................................................................35 Must-Use Plugins ................................................................................................36 How Should I Activate A Plugin? .......................................................................36 Deleting Plugins ..................................................................................................36

Managing Themes .....................................................................37 Installing Themes ................................................................................................37 Network Enabling and Disabling Themes ..........................................................37 Enabling A Theme For One Site ........................................................................38 Change the default theme ...................................................................................38 Deleting Themes .................................................................................................39 Editing Themes ...................................................................................................39

What Your Users Must Know ....................................................40 How Do Users Sign Up? ....................................................................................40 How Do Users Create New Sites? ......................................................................41 The Difference Between A Blog and A Multisite Blog? .....................................42

FAQ ............................................................................................44 Where are my sites? I don’t see them on my server! ...........................................44 All my images upload to files, but there’s no files folder! ....................................44

Can I make an existing site into a Multisite? ......................................................44 Why is the theme not working on my subsite? ....................................................45 How big is my database going to get? .................................................................45 How big is my server going to get? .....................................................................45 Will Multisite make my server slower? ................................................................45 How do I know which plugins are safe to use on Multisite? ...............................45 Can I install Multisite in a subfolder? .................................................................46 Can I make all my sites use the same media library? .........................................46 I need more help! Where can I go? ....................................................................46

Advanced Topics ........................................................................47 Go back to a single install ...................................................................................47 Exporting A Site ..................................................................................................47 Moving your network ..........................................................................................49 Pre-Configuring Plugins ......................................................................................49 Restricting Plugins ..............................................................................................49 Customizing Signup Pages ..................................................................................50 Mapping Domains ..............................................................................................50 Multiple Networks ..............................................................................................51 Splitting Your Database ......................................................................................52 Removing ‘Blog’ from the URL of your mainsite ..............................................52

Plugin Suggestions ......................................................................54 About The Authors ....................................................................56

WordPress Multisite 101 How to create a network without tearing out your hair. Self Published Second Edition

Copyright © 2012 Mika Ariela Epstein This ebook is released under a Creative Commons AttributionNoncommercial-ShareAlike license, which lets you share it, remix it, and share your remixes, provided that you do so on a noncommercial basis. You can give it away, but please don’t sell it. Putting it up on your website where you have ads, or using it in your class is fine. Putting it behind a paywall is not. http://creativecommons.org/licenses/by-nc-sa/3.0 WordPress Multisite 101 http://halfelf.org/ebooks/wordpress-multisite-101/ This ebook is released under a Attribution-NonCommercial-ShareAlike 3.0 Unported (CC BY-NC-SA 3.0), which lets you share it, remix it, and share your remixes, provided that you do so on a noncommercial basis. http://creativecommons.org/licenses/by-nc-sa/3.0/ This means you can give it away all you want, but please don’t sell it. Putting it up on your website where you have ads, or using it in your class is fine. Putting it behind a paywall, or in your own hard-copy for sale book is not. It’s provided free of charge, however you are encouraged to pay what you feel this book is worth. A suggested donation of $5 can be made at PayPal or WePay: https://www.paypal.com/cgi-bin/webscr?cmd=_sxclick&hosted_button_id=T8T7UVNR6X9C8 https://www.wepay.com/donations/ebook-wp-multisite-101

Code Licensing

All code samples, examples, snippets or otherwise on this blog are, unless explicitly otherwise noted, licensed under an GPL2 (or later) license: This software is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This plugin is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

Acknowledgements This book wouldn’t be possible without a very patient family, but also without WordPress itself. Without the amazing variety of configurations found on the WordPress forums, IRC and email list, as well as the hundreds of people who’ve just had one, odd little question, this information might have been lost forever.

Introduction WordPress is a well known blogging/CMS web application, popular for it’s ease of use. Once a user gets over the initial hurdle of mastering a new tool, they can configure a site in a dizzying array of ways. This eBook is intended to help you install WordPress, configure Multisite, and map domains on a Linux server running Apache. If you’ve never installed WordPress before, there will be some hurdles along the way, as Multisite is notably more complicated than running a single, stand alone, WordPress instance. We will not be discussing how to install WordPress, nor how to find a host, set up a database or any other basic webmastering skills. If you have never attempted to run a website before, Multisite is like trying to master the high dive and learn to swim at the same time. You can do it, but you’re making things very hard for yourself. Furthermore, this book will not delve into wether or not you should use Multisite. No one can really answer that question for you, so you should take the time to research what Multisite is and is not before you start.

Prerequisites For this book to be useful, you should already have mastered (or become familiar with) the following: 1. You already know how to install WordPress. If you’re starting from complete zero and know nothing about how to install WordPress, start with that and then come back to Multisite. 2. You already know how to access the files on your server. Be it via SFTP or SSH or even a File Manager on your host’s control panel, you must know how to edit the files on your server. 3. You know how to access your database. WordPress uses a database to store the content of your posts, as well as plugin settings and other site specific variables. If you don’t have

access to the database, via a tool like phpMyAdmin, you will have issues debugging. 4. You’re not afraid to open up files and look at them or edit them. One of the troubleshooting techniques this document will touch on requires you to be able to open up the WordPress files and edit them. 5. Familiarity with your server’s error logs. A good webhost can help in this respect, but knowing where the error log is will be invaluable. 6. You know how to turn off all plugins, and use the default theme. The first step of WordPress troubleshooting is to do that. If you can’t (or won’t), there will be complications.

Chapter 1

What Is Multisite? As of the release of WordPress 3.0 (17 June, 2010), WordPress has included a new feature known as ‘Multisite.’ Formerly, Multisite was separate product called “WordPress Multisite” or WPMU for short. The two were integrated and now allow users to seamlessly transition from running one WordPress install to many, without having to install multiple instances of WordPress! Multisite allows you to create additional blogs off your main install, either as subdomains or subfolders. We call this a Network and the blogs are referred to as Sites. When you use Multisite, there is one install of all your themes and plugins, as well as only one database. A WordPress Network is best thought of as a way to maintain multiple separate sites. Each site exists in it’s own bubble, with users, plugins, and themes all configured per-site. While it is possible to share content, this is considered an ‘advanced’ feature. For a good example of what a WordPress network looks like, go check out http://wordpress.com - They have multiple separate sites, all named ‘example.wordpress.com’ or via a mapped domain. Each site is separate, with it’s own users, design, etc. When you use Multisite, the out-of-thebox settings will create sites similarly. While code is shared between sites, configurations are not.

Special Terms

For those familiar with WordPress, there are a few additional terms that are used with Multisite. Super Admin - A super admin, also known as the Network Admin, is a user who has access to the entire network, can add and delete sites and users, install themes and plugins, and basically do whatever they want. This access is automatically granted to the account you specify when you activate Multisite. While you can add others later, you should be very careful with whom you permit this access. http://halfelf.org/ebooks/wordpress-multisite-101/!

Page 11 of 56

Network - The ‘network’ refers to your collection of sites. Sites - A site is a blog, though as you don’t have to have your site act like a blog, WordPress uses the more generic term here. Main Site - Your main site is the first one you installed, normally found at http://example.com and, in the database, has the ID of 1. Sub Sites - All additional sites on your network will be referred to as sub sites, regardless of if you are using subdomains or subfolders.

http://halfelf.org/ebooks/wordpress-multisite-101/!

Page 12 of 56

Chapter 2

When You Install WordPress... You should already know how to install WordPress, however there are a few ‘gotchas’ to be aware of. For the purpose of this tutorial, we are assuming your HTML folder on your server is called /public_html/ - This folder is also called the ‘root’ of your website. Depending on your server, this can be named differently. A popular name is also www.

If you install in a directory and run it from ‘root’, configure it before you turn on Multisite

One of the most popular things to do is to install WordPress in a folder off of the HTML root - for example in /public_html/wordpress/ - but use the forward facing URL of http://example.com instead. 1 As of WordPress 3.5, you can do with with Multisite. Simply install WordPress in the subfolder and set it up to run from root before you create your subsites.

You cannot end your Database Prefix with a number

The default option is to use the prefix of wp_ which works just fine. Naming your prefix wp1_ or, worse, wp1 (without an underscore) will cause conflicts with the numbering structure WordPress uses for per-site tables.

You should not use www in your URL

A lot of people complain about this. The simple fact is that any well built server will automatically redirect www.example.com to example.com seamlessly. By removing it from our install, we avoid any possible conflicts with subdomains. Your SEO will not be impacted. Making your address URLs look like this is the best way to go:

1

See http://codex.wordpress.org/Giving_WordPress_Its_Own_Directory for directions on how to do that on a single install of WordPress.

http://halfelf.org/ebooks/wordpress-multisite-101/!

Page 13 of 56

Test Pretty Permalinks

Before you turn on Multisite, make sure you can use Pretty Permalinks. This essentially tests your server’s ability to use mod_rewrite, which is that cool thing that translates URLs from http://example.com/?p=1 to http://example.com/hello-world/ Simply put, if pretty permalinks don’t work, Multisite will never work.

http://halfelf.org/ebooks/wordpress-multisite-101/!

Page 14 of 56

Chapter 3

Before You Activate Multisite With WordPress up and running, now is the time to turn on Multisite! But wait… We’ve done the legwork to make sure our URLs won’t cause problems, and we know that mod_rewrite works. What’s left? There are some decisions to be made before you activate Multisite, such as...

Subdomains vs Subfolders A subdomain install means that your sites will look like this: • Main site:

http://example.com/

• Sub Site #1:

http://site1.example.com/

• Sub Site #2:

http://site2.example.com/

A subfolder install means your sites will look like this: • Main site:

http://example.com/

• Sub Site #1:

http://example.com/site1/

• Sub Site #2:

http://example.com/site2/

In addition, if you use a subfolder install, the post URLs on your main site will have the slug /blog/ prepended to them, causing them to look like this: http://example.com/blog/2012/03/hello-world/ At this time, you cannot easily customize that slug or remove it. There is no SEO benefit to using subdomains or subfolders, and you can map a domain name to either install, so the decision is purely cosmetic.2

Wildcard Subdomains

If you want to use subdomains, most people suggest activating Wildcard subdomains if at all possible. This will allow you to create a new subdomain site and have it automatically function without any manual

2

See http://www.mattcutts.com/blog/subdomains-and-subdirectories/ for an explanation

http://halfelf.org/ebooks/wordpress-multisite-101/!

Page 15 of 56

intervention. You can still manually create subdomains if you want, of course. There are two steps that need to be completed for this to work.3 First up, in Apache, there needs to be a line in the domain’s virtual hosts section as follows: ServerName yourdomain.com ServerAlias yourdomain.com *.yourdomain.com DocumentRoot /home/yourdomain/public_html/ ServerAdmin [email protected] The Server Alias line with the *.yourdomain.com is what controls this. If you do not have access to change this, ask your webhost for support. More and more hosts are enabling this by default. Second, you must make sure your DNS record is correctly configured for wildcard subdomains. Most are, by default, however you may need to add in a line like this: *.

IN

A

YOURIPADDRESS

That will redirect all requests back to your main install. If you’re using cPanel (a popular control panel for webhosts), it’s generally as simple as making a subdomain named *

This takes care of both the DNS and the Virtual Host.

3

Directions modified slightly from http://wpmututorials.com/how-to/enabling-wildcard-subdomains/

http://halfelf.org/ebooks/wordpress-multisite-101/!

Page 16 of 56

If you’re using Plesk, it gets a little more complicated, and you should ask your webhost for help.

Restrictions

To expand a little on the previous chapter, there are specific situations in which you cannot create a network. When you install Multisite, you start with a basic WordPress install. With a fresh install on it’s own domain, there are few additional concerns, however sometimes people want to install a ‘test’ Multisite on their localhost. When you do that, there are some additional concerns. You cannot create a network in the following cases: • "WordPress address (URL)" uses a port number other than ':80', ': 443'. In addition, you cannot choose subdomains in the following cases: • The WordPress URL contains a path, not just a domain. (That is, WordPress is not installed in a document root, or you are not using the URL of that document root.) • "WordPress address (URL)" is localhost. • "WordPress address (URL)" is IP address such as 127.0.0.1. It is possible to switch between subdomain and subfolder installs at a later date, however you will need to be comfortable with editing your database to do so, and it’s not recommended.

http://halfelf.org/ebooks/wordpress-multisite-101/!

Page 17 of 56

Chapter 4

Creating A Network Now we’re ready to go!

ALLOW MULTISITE

To enable the Network Setup menu item, you must first define multisite in the wp-config.php file. Open up wp-config.php and add this line above where it says /* That's all, stop editing! Happy blogging. */ If it doesn't say that anywhere, then add the line somewhere above the first line that begins with require or include: define('WP_ALLOW_MULTISITE',true); It should look something like this:

Making this change activates the Network Setup.

Network Setup

Look under ‘Tools’ where you’ll see a new menu item called Network Setup.

http://halfelf.org/ebooks/wordpress-multisite-101/!

Page 18 of 56

Go to that screen and you will be greeted by a welcome message and a few questions.

Select the type of network you want. Then review the Network Details section

Make sure you put the email of your admin user for the email address. This user will become the Super Admin and have superuser access to the entire network. This is different than a site admin, but we’ll get to that a little later on. Once you press save, you’ll be brought to a new screen with three steps.

ENABLING THE NETWORK

You must complete these steps before continuing.

Create blogs.dir If your server created the wp-config.php file and uploads folder when you installed WordPress, you may not need to complete these steps. But just in case you do, here’s how.

http://halfelf.org/ebooks/wordpress-multisite-101/!

Page 19 of 56

The blogs.dir is folder where all sites except your main site will store uploaded files. The main site will use the traditional location of wpcontent/uploads/, but all subsequent sites will be created in wpcontent/blogs.dir/#/files/ (where # is the unique id assigned to your site). The blogs.dir folder requires the same types of permissions as the uploads folder did, so if you had to make special changes for that (like setting permissions to 777), do that here as well.

Add More Lines to wp-config.php

You’ll need to add these lines to your wp-config.php, right below where you added that first line. Do not delete that first line! It looks a lot like the first line in the new section, but it’s not the same! define('MULTISITE', true); define('SUBDOMAIN_INSTALL', true); $base = '/'; define('DOMAIN_CURRENT_SITE', 'example.com'); define('PATH_CURRENT_SITE', '/'); define('SITE_ID_CURRENT_SITE', 1); define('BLOG_ID_CURRENT_SITE', 1); You’ll notice that true is bolded. If you’re using subdomains, this is true. If you’re not, that will be false. Remember, that is an example of the output, yours may be different. Always copy from what your WordPress install has.

Update your .htaccess

There are two main versions of .htaccess for Multisite, depending on if you chose subfolders or subdomains. Since you’ve tested your pretty permalinks already before turning on Multisite, your .htaccess should contain this: # BEGIN WordPress http://halfelf.org/ebooks/wordpress-multisite-101/!

Page 20 of 56

RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] # END WordPress If it does, delete it. If you have anything else in your .htaccess you can keep it, but make sure to remove the old WordPress lines, and put these new ones in at the very bottom of your .htaccess file. Remember, WordPress’s calls always go on the bottom!

‘Reboot’ Once you’ve done all that, log out of WordPress and then log back in. You may need to clear your browser’s cache to make things work. Once you log back in, you should see the new My Sites menu on the toolbar.

http://halfelf.org/ebooks/wordpress-multisite-101/!

Page 21 of 56

Chapter 5

Basic Configuration Options The big question you have left is ‘Now what do I do?’ By default, no one can register an account on your network and no one (save you, the Super Admin 4) can make new sites. There are additional limitations on who can see plugins, who can upload files and so on. Most people want to tweak those before opening their site to the public. The Super Admin section has its own dashboard, found at http:// example.com/wp-admin/network/ and it’s there you’ll be able to start configuring your network.

Very similar to the normal dashboard, the ‘Right Now’ section lists how many users and sites you have, with handy links to create new ones. We’ll get to that in a minute. Network settings has the majority of the basic configuration you’ll want to edit. You can get there by going to the Settings menu, and opening Network Settings.

4

You may hear the ‘Super Admin’ referred to as the ‘Network Admin’ or ‘Super Grover’ or even ‘Cape Wearing Users’ - They all mean the same thing.

http://halfelf.org/ebooks/wordpress-multisite-101/!

Page 22 of 56

There’s quite a bit of information on this page, and much of it can be confusing. Some of the settings require familiarity with how servers are designed, while others are very obvious. We’ll take them by the numbers.

OPERATIONAL SETTINGS These settings are pretty obvious. You can change the Super Admin email to anything you want, but make sure it really does exist.

Registration Settings

There are multiple settings in this section. An important point to remember is that users are network wide. Once created, they have the potential to be added to any site on the network. Naturally they’re not all given that access, though they can be, but this is why, when you add a new user, they don’t show up on a site right away. You have to add them to the network, then to the site.

Allow New Registrations

By default, no one can register. The settings are fairly obvious. People can either not register, register for accounts, get an account and then make a site, or be able to create an account and a site at the same time.

WordPress.com allows users to create both sites and user accounts at the same time. This does not mean you should do the same thing! http://halfelf.org/ebooks/wordpress-multisite-101/!

Page 23 of 56

Allowing anyone under the sun to register and make a site on your network can be risky if you’re not prepared to support all those people. Remember, what they post on your site is your responsibility, and if they break the law, or bring the ire of someone on them, you pay the price. Be responsible.

Registration Notification

This one’s straight forward. The email goes to the address listed in Super Admin Email.

Add New Users

If checked, admins of sites can add new users to the network and their sites. Otherwise, they can only add users that already exist on the network to their sites.

Banned Names

The listed names cannot be used for user names or blog names. You really don’t want to remove the ones listed, but adding to them is fine.

Limited Email Registrations

You can restrict your site so only the domains listed can join your site. This is particularly useful if you’re running a site for a school or a company. Just put example.edu or example.com in the box.

Banned email domains

You can block emails from being able to register.

NEW SITE SETTINGS

All the options in this section will help you customize what new sites on your network look like. Make special note of any ‘constants’ like SITE_NAME or USERNAME. These are special variables used by WordPress, and deleting them will make it hard to recover. These settings mimic the defaults that you see on a normal WordPress install. • Welcome Email is what the new site admin receives when their site is created. • Welcome User Email is what new users added to the site receive http://halfelf.org/ebooks/wordpress-multisite-101/!

Page 24 of 56

• First Post is the first post, commonly known as ‘Hello World.’ • First Page is the first static page, usually used as an ‘About’ page. • First Comment is the sample comment left, to show what comments look like. • First Comment Author is the name of the comment author. • First Comment URL is the URL, if you want one.

UPLOAD SETTINGS

These settings can limit the upload abilities of subsites. If you intend to upload large files like videos, you will need to change the settings accordingly. If you want to keep the defaults low, but customize individual sites, you can do that in another section

http://halfelf.org/ebooks/wordpress-multisite-101/!

Page 25 of 56

Chapter 6

Managing Sites Sites can only be created with characters a-z and 0-9. While a Super Admin can go in and add other characters (like underscores or hyphens) later, it’s suggested this be avoided, especially if you’re using subdomains. Not all servers support non-alphanumeric characters in subdomains.

ADD NEW SITE

Adding a new site as the admin is simple. From the Super Admin dashboard, you can either click on the ‘Create a New Site’ link or go to the Sites menu and click on ‘Add New.’ Either will bring you to a new screen called Add New Site.

Simply enter in the information and a new site will be created. As the Network Admin, you will be able to use any character, and not just a-z and 0-9.

http://halfelf.org/ebooks/wordpress-multisite-101/!

Page 26 of 56

LISTING SITES

Your sites will be listed on the Sites menu under the listing ‘Sites’ and will appear thusly:

You can also get a list of sites off the toolbar, however these will only show sites that your ID is an administrator of. If you create a site and make another user the site admin, you will not see it listed in the toolbar.

EDITING, DELETING AND ARCHIVING SITES

If you hover over a site, you will see new options:

• Edit will take you to a screen where you can change site options. • Dashboard takes you to the normal wp-admin dashboard. • Deactivate and Archive both close the site and prevent non logged in users from seeing it. • Spam marks a site as spam and locks it. • Delete removes the site and all its content from the database. • Visit goes to the site URL.

http://halfelf.org/ebooks/wordpress-multisite-101/!

Page 27 of 56

Edit

The Site Edit feature is where you can can customize settings normally found on the ‘Settings’ menu of the Dashboard. There are four main sections.

Info

The basic site information, like domain, path, registration date, and status are found here. While it is possible to change a site name in this section, doing so on an existing site can have a dramatic outcome if you change the length of the site name.

It’s in this section you can add non-alphanumeric characters, however do so with caution, for the reasons mentioned earlier.

Users The users tab lists all users on the site. We’ll talk more about how to add users later. Suffice to say, if you have users on the network and wish to add or remove them to the site, you can do so here.

http://halfelf.org/ebooks/wordpress-multisite-101/!

Page 28 of 56

Themes

The themes tab lists all the themes installed on the network. If they’re greyed out, they are currently not available to this site. This will be explained in more detail in the themes section.

Settings The settings tab is a highly advanced section that the vast majority of you will never need to edit. That said, it’s often easier to go here and make changes than it is to poke around the dashboard of each site to make adjustments. Also, there are a few settings users expect to see on a normal admin dashboard, like the media settings where they can change the file upload directory, that simply don’t show on Multisite. The reason is that with a Multisite, you’re using shared space. It’s much easier to support users if everyone has the same setup. Also, the normal admin users don’t generally have access to create new directories on the server, so you, as the Super Admin, must create the folders and make the appropriate changes. The one setting most people will need to update is at the very bottom - Site Upload Space Quota - which can be changed to allocate more or less disk space on a per-site basis. Everything in this section makes a direct edit to your database. Edit with extreme caution, and if you’re not sure, ask for help or leave it alone.

http://halfelf.org/ebooks/wordpress-multisite-101/!

Page 29 of 56

Chapter 7

Managing Users By default, users are added to the Network, not an individual site. This causes much confusion with users, as they think they’ve signed up for a site, but instead they have to be added. Also, unlike a single site install, you must use only lowercase letters. This is because, when users are permitted to create a user account and site together, the default path of the site matches their user name. For example, if a user logged in and requested the username of foobar, they would be prompted to create a site with the URL http://example.com/ foobar If permitted, users can register to the network themselves. Otherwise you will need to add them. Site Admins can always add existing users to their sites, but they cannot add new users to the network unless that setting is checked in Super Admin > Settings. Users who do not belong to any site are still able to log in to the network, but they only have access to the special user dashboard and profile: http://example.com/wp-admin/user/ . Here they can edit their profile, which is network wide.

HOW TO ADD NEW USERS TO THE NETWORK For the Super Admin, the easiest way to add a user it so go to Super Admin > Users > Add New, and fill in the form.

http://halfelf.org/ebooks/wordpress-multisite-101/!

Page 30 of 56

HOW TO ADD NEW USERS TO A SITE Via the Super Admin

Go to Super Admin > Users > All Sites to edit the site. Click on the users tab and add new user:

Via the Site Admin

Go to the dashboard of the site and go to Users > Add New. Fill in the form for Add New User.

Note: This is the only location where you can add a user and not email them a notification.

http://halfelf.org/ebooks/wordpress-multisite-101/!

Page 31 of 56

HOW TO ADD EXISTING USERS TO A SITE

If a user already exists on the network, either having registered themselves or by you, you will still need to add them to a site.

Via the Super Admin

Go to Super Admin > Users > All Sites to edit the site. Click on the users tab and add the user:

Select the role the user should have and hit save.

Via the Site Admin

This is only available to Super Admins, unless you’ve checked ‘Add New Users’ in the Network Settings section:

By default this is not checked. If it is, the site admin can go to their Dashboard and visit Users > Add User, and fill in the form for Add New User.

http://halfelf.org/ebooks/wordpress-multisite-101/!

Page 32 of 56

Again, this is the only location where a user can be added without sending a notification email.

HOW TO ADD USERS TO ALL SITES This can only be done via plugins, and will be addressed in the advanced section.

HOW TO MAKE A NEW SUPER ADMIN

As a Super Admin you have access to do anything, from installing plugins and themes, to added and deleting users and sites. This is different than being the administrator of a site on the network. A site admin only has access to make changes on their own site. Because of the elevated permissions a Super Admin has, you should only give this access to people you trust completely. In order to make a user a Super Admin, go to Network Dashboard > Users and click on ‘edit’ for the user. On that page, you will see an option under Username that says Super Admin. Check the box and click save.

http://halfelf.org/ebooks/wordpress-multisite-101/!

Page 33 of 56

You can remove access the same way, from all users except your own. If there is only one Super Admin, access cannot be removed, which is a good thing!

http://halfelf.org/ebooks/wordpress-multisite-101/!

Page 34 of 56

Chapter 8

Managing Plugins Unless you’ve enabled the plugins menu in Site Settings, site admins will not be able to see which plugins are installed, nor will they be able to activate or deactivate plugins.

Plugins are installed in the same location as a regular WordPress install, and are available for use on all sites. Only the super admin may install plugins, in order to prevent an ignorant or malicious user from crashing your network. If the menu is available, site admins will see all inactive or per-site activated plugins.

INSTALLING PLUGINS

Plugins can be installed via FTP/SSH or using the plugin administration page on Super Admin > Plugins > Add New. The screens are identical to that of the normal WordPress install save the last. Once the plugin is installed, you are given the option to Network Activate instead of simply ‘activate.’

ACTIVATING PLUGINS

There are two ways to activate plugins. You can Network Activate or you can activate per site. If the plugin admin menu is disabled, only the Super Admin can activate per-site, and you will need to visiting each site to do it. Network Activating a plugin forces it to ‘on’ on all sites in your network. Doing so will make it invisible to all site admins, and the plugin will not be shown on their ‘active plugins’ list. http://halfelf.org/ebooks/wordpress-multisite-101/!

Page 35 of 56

Activating a plugin per-site simply means that the site was activated via the site’s dashboard in the Plugins menu. This can be done by a Super Administrator or, if permitted, the site admins.

MUST-USE PLUGINS If you are using the Multisite version of WordPress, Must Use Plugins are special WordPress Plugins installed in a special directory next to the normal /plugins/ dir (/mu-plugins/). They are 'must-use' because once their file is placed in the /mu-plugins/ directory. They are instantly activated and cannot be de-activated using the admin plugins panel, as don't even show up on the list for non super admins. Must-use Plugins are useful for providing functionality across the entire blog network. They are loaded before normal plugins, which means that code and hooked-functions registered in an mu-plugin can be assumed available to all other plugins. Must-use plugins are never shown on the per-site plugin page, to any users. They can only be seen on the Super Admin’s plugin page.

HOW SHOULD I ACTIVATE A PLUGIN?

This is a complicated question. For the most part, any well-written plugin will function regardless of if it’s activated per-site or network wide. Certain plugins are only able to be activated on the network, and those will not permit you to activate them per-site. Other plugins will recommend you activate per-site. Always read the plugin documentation fully before activating. In general, you should only use the Must-Use Plugins location if directed to do so by the plugin author. Should the plugin not function correctly when network activated, deactivate it and try using it per-site.

DELETING PLUGINS

Generally, you can delete plugins the same way you added them, via the Super Admin. The caveat is that if a plugin was activated per-site on the main site of your network, you’ll have to go deactivate it first, and then delete. If the plugin was network activating, or active on any other site, it can be deleted. http://halfelf.org/ebooks/wordpress-multisite-101/!

Page 36 of 56

Chapter 9

Managing Themes Themes, like plugins, are only able to be installed on the Network dashboard, under the Themes menu.

INSTALLING THEMES

Themes can be installed via FTP/SSH or using the plugin administration page on Super Admin > Themes > Add New. The screens are identical to that of the normal WordPress install save the last. Once the plugin is installed, you are given the option to Network Enable instead of simply ‘enable.’

NETWORK ENABLING AND DISABLING THEMES

Network Enabling a theme will make it available for use on all sites in your network. When you look at the Installed Themes on your Network Dashboard, you will see the ones that are network enabled in light grey, while the disabled ones are in dark grey. On an individual site dashboard, all Network Enabled themes are displayed as installed themes. http://halfelf.org/ebooks/wordpress-multisite-101/!

Page 37 of 56

To enable or disable, simply click on the Network Enable or Network Disable links. Disabling a theme will not remove it from any site that’s currently using the theme. The theme will remain active on those sites, but they won’t be able to change back to it, should they switch to a different theme.

ENABLING A THEME FOR ONE SITE

If you have a theme you want to enable for only one site, you will have to go to the Network Dashboard, click on ‘All Sites’ and edit the site. From there, go to the ‘Themes’ tab. There you will see any non-network enabled theme. Click on Enable and the theme will be available on that site.

CHANGE THE DEFAULT THEME

The WordPress default theme (currently Twenty Eleven) is the default theme for all sites. This can be changed to any theme you have installed on your server by editing the wp-config.php file. Add this line below your Multisite section in that file:

http://halfelf.org/ebooks/wordpress-multisite-101/!

Page 38 of 56

define('WP_DEFAULT_THEME', 'classic'); Where classic is the folder name of your new default theme.5

DELETING THEMES

You can delete themes the same way you added them, via the Super Admin. If you delete a theme that’s in use, any site that was using that theme will display a blank white page to all visitors, until someone changes the theme in either the site dashboard or the network dashboard. For this reason, it’s considered a bad idea to delete an active theme.

EDITING THEMES

Only the super admin can edit themes, and this is done via the Network Dashboard, under Themes > Edit Themes Remember, when you edit a theme’s core files, you edit them for all sites on your network. If admins of other sites need to edit their theme, you can install the Safe CSS plugin to allow them to edit their CS. If they need more than that, you may need to make them their own theme. http://wordpress.org/extend/plugins/safecss/

5

See http://wpmututorials.com/how-to/change-the-default-theme-for-sites-without-a-plugin/ for more information.

http://halfelf.org/ebooks/wordpress-multisite-101/!

Page 39 of 56

Chapter 10

What Your Users Must Know Now that everything’s set up, it’s time to get those users!

HOW DO USERS SIGN UP?

Provided you allow for user registration, visitors can go to http:// example.com/wp-signup.php and register for a new account.

They will be emailed their password, and cannot access the site without activating their account.

You cannot activate an account for a user, even as a super admin, so if they don’t get the email, or don’t reply, it can get messy, as the only way to purge out the activations is through the database. http://halfelf.org/ebooks/wordpress-multisite-101/!

Page 40 of 56

If you allow users to create an account and a blog at the same time (called ‘Open Registration’) the form includes the following option:

If you have a subdomain install, going to http://fakesub.example.com will send you to http://example.com/wp-signup.php?new=fakesub and allow them to register, with an additional note:

HOW DO USERS CREATE NEW SITES?

If the user is creating a new site when they register, they have the option to click on ‘Gimme a site!’ when they pick their user name. By default, the user name is filled in as the blog name, but that can be changed. Simply fill in the form and click ‘Signup.’ for the site to be created.

http://halfelf.org/ebooks/wordpress-multisite-101/!

Page 41 of 56

If the user is creating a site after they made an account, they simply go back to http://example.com/wp-signup.php and fill in this form:

This form is also what you see if you want to create additional sites. There are no default limits to how many sites a user can make, but you can limit them via plugins.

THE DIFFERENCE BETWEEN A BLOG AND A MULTISITE BLOG?

When you run your own single install of WordPress, you’re actually the ‘Super Admin’ of your site! When you’re a site admin, you have slightly fewer powers. It’s easier to explain what you can’t do as a Site Admin: • You can’t change the URL of your site. • You can’t move the location of media files. • You can’t use ‘embed’ codes for videos6 • You can’t post by email. 6

We suggest you use oEmbeds instead - http://codex.wordpress.org/Embeds

http://halfelf.org/ebooks/wordpress-multisite-101/!

Page 42 of 56

• You can’t install plugins or themes. • You can’t edit plugins or themes. As you can see, there are limitations, however most of these cause no issues to your site admins.

http://halfelf.org/ebooks/wordpress-multisite-101/!

Page 43 of 56

Chapter 11

FAQ Before we get to the advanced topics, let’s take a moment to go over the most common questions.

WHERE ARE MY SITES? I DON’T SEE THEM ON MY SERVER! If you mean ‘Why isn’t there a folder called sitename on my server?’ the answer is that they are virtual. Just like you can’t see the ‘files’ for posts and pages on your server, everything that contains the information for your site on a network is in the database. The only files that are uploaded are images.

ALL MY IMAGES UPLOAD TO FILES, BUT THERE’S NO FILES FOLDER! That’s okay! Your images on subsites upload into /wp-content/ blogs.dir/#/files and, through the magic of .htaccess, they are redirected from http://site2.example.com/files to http://example.com/ blogs.dir/2/files/ How does that work? In your .htaccess there’s a line like this: RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wpincludes/ms-files.php?file=$2 [L] That line says ‘Any URL that goes to /files/ should be redirected to /wp-includes/ms-files.php instead’ And it’s that file which detects what site you’re coming from, where the image actually is, and outputs it for your visitors. By the way, don’t make a folder (or file, or page) named ‘files’ or you’ll break the redirect magic.

CAN I MAKE AN EXISTING SITE INTO A MULTISITE? Sure, but there are caveats.

http://halfelf.org/ebooks/wordpress-multisite-101/!

Page 44 of 56

By default, WordPress will only let you turn on subdomains if your site has existing for more than 60 days. This is to avoid possible conflicts between pages on your main site and your new subsites. You can change that (just change the value for ‘Subdomains’ when you define it in your wp-config.php), however remember that your URLs for posts will have /blog/ prepended to them, and that can cause 404s on your site. This can normally be fixed with some .htaccess magic.

WHY IS THE THEME NOT WORKING ON MY SUBSITE? If you get unstyled content on your subsites, where all you see is the content but no theme formatting, the odds are your server isn’t reading your .htaccess file correctly. Normally that occurs when mod rewrite isn’t enabled (though if you verified that pretty permalinks work before you turned on Multisite, you know they are), or that your httpd.conf file doesn’t have AllowOverride set to ALL. If you don’t know how to edit that file, or don’t have access, ask your webhost.

HOW BIG IS MY DATABASE GOING TO GET?

That depends on how you look at it. For every site you create on your network, you will have, minimum, nine new tables created. That can add up pretty fast, especially if you have open registration. Normally, however, this isn’t a problem, as most sites are relatively small.

HOW BIG IS MY SERVER GOING TO GET? Depends on how many images people upload, and how big they are. But yeah, that can get big too.

WILL MULTISITE MAKE MY SERVER SLOWER? Indirectly. See, the more sites you have on your server, the more traffic you have. The more traffic, the slower the server, unless you optimize it. There are minification and caching plugins that can help, but also sitting down and tuning your server will help exponentially.

HOW DO I KNOW WHICH PLUGINS ARE SAFE TO USE ON MULTISITE?

Most plugins work just fine if you activate them per-site. Some plugins don’t. If a plugin is tagged ‘multisite’ or ‘wpmu’ in the official plugin http://halfelf.org/ebooks/wordpress-multisite-101/!

Page 45 of 56

repository, it’s a good bet that it’ll work. If it’s not, well, you have to experiment a little. Always read the full documentation on a plugin before installing!

CAN I INSTALL MULTISITE IN A SUBFOLDER? Sure, with caveats. • You can’t map domains • All your URLs will contain that subfolder name. Same thing for subdomains.

CAN I USE ‘GIVING WORDPRESS IT’S OWN DIRECTORY’ WITH MULTISITE?

As of WordPress 3.5, yes you can. If you want to install in http:// example.com/wordpress but have your main site use the URL http:// example.com then just install it like you normally would in that case and set up the ‘own directory’ before Multisite. Otherwise you have to move Multisite, and that’s not really easy.

CAN I MAKE ALL MY SITES USE THE SAME MEDIA LIBRARY?

No. No plugin currently exists that permits this, and it’s out of the scope of Multisite.

I NEED MORE HELP! WHERE CAN I GO?

http://wordpress.org/support/forum/multisite/

http://halfelf.org/ebooks/wordpress-multisite-101/!

Page 46 of 56

Chapter 12

Advanced Topics If you’ve gotten this far, you’re ready to run a network! As with all things, there are some more advanced topics. From this point on, you will have to be comfortable with managing the files on your server and accessing the database. Many of these topics will use plugins, as well.

GO BACK TO A SINGLE INSTALL

After all that, sometimes people realize that they didn’t want Multisite. It can be removed fairly painlessly.7 1. Delete any extra sites you may have created, either moving the content and users to the main blog or wherever you desire. One the sites are deleted, you cannot retrieve the content. 2. Remove the lines added in the wp-config.php file. 3. Restore the .htaccess file to the default (you can usually restore these by resaving the permalinks). 4. Remove the wp-content/blogs.dir (don’t worry, your main site stored everything in wp-content/uploads). 5. Drop these global tables from the database: wp_blogs wp_blog_versions wp_registration_log wp_signups wp_site wp_sitemeta That’s it!

EXPORTING A SITE 7

Edited from http://wpmututorials.com/how-to/how-to-disable-multisite/

http://halfelf.org/ebooks/wordpress-multisite-101/!

Page 47 of 56

If you want to export one site from the network and install somewhere else, you will have to make a couple important decisions. If all you care about is the content, a traditional WordPress export will be just fine.8 You can simply import the content on the new location, be it a separate install of WordPress, or just a different site on your network.9 If you need to keep the look and feel of your site, all the plugins, theme settings, and users, it’s vastly more complicated. The basic steps would be to: 1. Install WordPress in the new location. 2. On the existing site, make a note of all users on the site and their user ID. 3. Create your authors (their passwords will change, everyone will have to cope) 4. Export all the wp_x_[tables] from your database, where x is the site ID. 5. Rename the tables in that export file to just wp_[table] 6. Search the export file for the old site URL (i.e. http:// example.com/sitename/ ) and replace with the new one (i.e. http://newexample.com ) 7. Make a list of all the users and their IDs. Compare this to the list you made in step 2 and make sure you know everyone’s old and new user ID. 8. Edit the wp_posts values for post_author, changing accordingly based on the table you made in step 7. 9. Import the database. 10.Copy /wp-content/blogs.dir/ID/files/ from the old server, and place it in /files/ on your new server. If at all possible, just use the traditional export/import. You’ll get a much cleaner database in the end. 8

To export, see http://codex.wordpress.org/Tools_Export_Screen

9

To import, see http://codex.wordpress.org/Tools_Import_Screen

http://halfelf.org/ebooks/wordpress-multisite-101/!

Page 48 of 56

MOVING YOUR NETWORK

Moving a network from one server to another, provided none of the URLs are changing, is as simple as copying over the database and all the files. If, instead, you are changing domains, then the best way to move Multisite is to move the files, edit the .htaccess and wp-config.php (if the folder name containing Multisite changed), and then manually edit the database. Search for all instances of your domain name, and change them as needed. This step cannot yet be easily automated. It's safe to search/ replace any of the wp_x_posts tables, however do not attempt blanket search/replace without a special search and replace script. You can get a copy of the Search and Replace Script at http:// interconnectit.com/124/search-and-replace-for-wordpress-databases/ If you're moving Multisite from one folder to another, you will need to make sure you edit the wp_blogs entries to change the folder name correctly. You should manually review both wp_site and wp_blogs regardless, to ensure all sites were changed correctly. Also manually review all the wp_x_options tables and look for three fields and edit as needed: home siteurl fileupload_url If you are moving from subdomains to subfolders, or vice-versa, remember to adjust the .htaccess file and the value for SUBDOMAIN_INSTALL in your wp-config.php file accordingly.

PRE-CONFIGURING PLUGINS By default, plugins are either on or off, and the settings are handled per-site. In some cases, you want to pre-configure plugins for your users. In order to do that, you need to use the plugin ‘YD WPMU Sitewide Options.’ http://wordpress.org/extend/plugins/yd-wpmu-sitewide-options/

RESTRICTING PLUGINS http://halfelf.org/ebooks/wordpress-multisite-101/!

Page 49 of 56

If a plugin is not network activated, it’s available for all sites to activate as they chose. Sometimes you don’t want this, but instead want to limit certain plugins to only be run on certain sites. There are multiple plugins that can be used for this, depending on how you want to manage plugins. Exclude Plugins Exclude plugins from appearing in plugins menu for normal user in WordPress multisite. http://wordpress.org/extend/plugins/exclude-plugins/ Restrict Multisite Plugins Provides an interface similar to how the ‘themes’ section looks. http://wordpress.org/extend/plugins/restrict-multisite-plugins/ Plugins Enabler Hides all plugins by default, and allows you to re-enable per-site. http://wordpress.org/extend/plugins/plugins-enabler/ Multisite Plugin Manager Allows you to manage plugin activation. http://wordpress.org/extend/plugins/multisite-plugin-manager/

MAPPING DOMAINS You can run multiple domains from one Multisite, by using a domain mapping plugin. You will need to create a site for each domain, but once that’s done, it’s fairly simple to map the domain. The plugin ‘WordPress MU Domain Mapping’ is very reliable. http://wordpress.org/extend/plugins/wordpress-mu-domain-mapping/ The complicated aspect of mapping a domain is in mapping the domain to your server. The basic step is to point the DNS settings of your new domain to your existing server. However, depending on your host, you may also have to park the domain in order to add it to your own DNS server. If you’ve never parked a domain, or made an add-on, you should check with your webhost first. Once you’ve sorted out mapping the domain, you can point it to your site ahead of time, and verify it works by going to http:// newdomain.com, which should take you right back to http:// example.com/ http://halfelf.org/ebooks/wordpress-multisite-101/!

Page 50 of 56

From the Domain Mapping menu, set either your Server IP or the CNAME, pick your options, and hit save. The options are as follows: • Remote Login – All sites will log in through your main domain. This is good, because once you’ve logged in to one, you logged in to all (due to how cookies work). The downside is everyone will see their URL change when they log in. • Permanent redirect (better for your blogger’s pagerank) – Instead of using your original URLs (like http://subsite.example.com ) you now use http://newdomain.com. Leave this checked, you want it. • User domain mapping page – If you want to allow users to map their own domains, check this. • Redirect administration pages to blog’s original domain (remote login disabled if redirect disabled) – All sites Dashboards will remain referencing the main domain (i.e. http:// subsite.example.com/wp-admin instead of http:// newdomain.com/wp-admin ) • Disable primary domain check. Sites will not redirect to one domain name. May cause duplicate content issues. - As it says. • Then you go to the ‘domains’ Menu and add in a new domain. It’s as simple as filling in this form:

That’s it!

MULTIPLE NETWORKS http://halfelf.org/ebooks/wordpress-multisite-101/!

Page 51 of 56

If you’re running subdomains, sometimes you want to be able to create sub-sites off the subdomains, like http://subsite.example.com/newsite, or, in the case of mapped domains, have it run it’s own network. While it is possible, it always requires a plugin, and it can get complicated very quickly. WP Multi Network http://wordpress.org/extend/plugins/wp-multi-network/ Networks+ ($25.95) http://wpebooks.com/networks/

SPLITTING YOUR DATABASE

If your site gets very large, you may need to split it into multiple databases. HyperDB and SharDB are the best plugins for the job, but both require a great deal of SQL savvy. http://wordpress.org/extend/plugins/hyperdb/ http://wordpress.org/extend/plugins/shardb/

REMOVING ‘BLOG’ FROM THE URL OF YOUR MAINSITE

If you installed Multisite as a subfolder setup, you may recall that the /blog/ slug shows up in your posts, and you were told you can’t change that? Actually, you can remove this if you absolutely must, but it’s not supported nor recommended. Go to Network Dashboard -> Sites and edit your main site. Click on the ‘Settings’ tab and scroll down till you see Permalink Structure. Delete /blog from that so you just have /%year%/ %postname%/ or whatever you want your format to be.

Please keep in mind, you now can never edit your permalinks on your main site, except through this method. If you go to your main site’s

http://halfelf.org/ebooks/wordpress-multisite-101/!

Page 52 of 56

dashboard and use the Permalink page there, the slug will magically return.

http://halfelf.org/ebooks/wordpress-multisite-101/!

Page 53 of 56

Chapter 13

Plugin Suggestions Many tweaks to your site will require you to install plugins. The following plugins are some of the more popular additions to Multisite.

List All Posts from All Sites There are a few different ways to do this. The most reliable method is to use the, oddly named, plugin ‘WordPress MU Sitewide Tags,’ which will copy all posts from all sites to one ‘tag’ site, which can then be used to list all posts. http://wordpress.org/extend/plugins/wordpress-mu-sitewide-tags/

Posting Content to Multiple Sites This can be done via plugins, depending on how you want to push the content. ThreeWP Broadcast Broadcast a post/page to other blogs. Whitelist, blacklist, groups and automatic category+tag posting/creation available. http://wordpress.org/extend/plugins/threewp-broadcast/ Multipost MU Allows you to duplicate posts and pages to multiple sub-blogs at once. http://wordpress.org/extend/plugins/multipost-mu/

Network Menus Sharing a menu across multiple sites can be frustrating, since each site can edit its own menus. Using the ‘Networkwide Menu’ will help with that. http://wpmututorials.com/plugins/networkwide-menu/

Add users to all sites automatically

Multisite User Management lets you pick and chose what roles new users should have on each site on your network. http://wordpress.org/extend/plugins/multisite-user-management/ http://halfelf.org/ebooks/wordpress-multisite-101/!

Page 54 of 56

Configure New Site Defaults

WPMU New Blog Defaults extends the ‘New Site Settings,’ allowing you to edit everything from Blog Title and Date Format to XML-RPC and Comment Moderation. http://wordpress.org/extend/plugins/wpmu-new-blog-defaults/

Copying Sites

Blog Copier lets you duplicate an entire site, whole sale, into a new on. http://wordpress.org/extend/plugins/blog-copier/

Privacy

More Privacy Options and Network Privacy both extend the normal ‘hide my site from search engines’ and allow you to hide certain sites from non-members. http://wordpress.org/extend/plugins/more-privacy-options/ http://wordpress.org/extend/plugins/network-privacy/

Keep tabs on new blogs

Moderate New Blogs requires a site admin to approve all new sites. http://wordpress.org/extend/plugins/moderate-new-blogs/ Limit Blogs Per User limits the number of blogs any one user can create http://wordpress.org/extend/plugins/limit-blogs-per-user/

Spam Control

Nearly all spam plugins for WordPress will work on Multisite, however many need to be configured per-site. Sitewide Comment Control is a Multisite Only plugin that allows you to manage the ability of unregistered visitors to comment on all sites on your network. http://wordpress.org/extend/plugins/sitewide-comment-control/

http://halfelf.org/ebooks/wordpress-multisite-101/!

Page 55 of 56

About The Authors Mika Epstein (aka Ipstenu) Mika is a self-taught programmer who studied Anthropology and Creative Writing in university. While her day job is a nine-to-five software wage slave for The Man, she spends her free time playing with WordPress, among other open source web products. A regular volunteer in the forums, Mika also writes the occasional plugin. Mika blogs about technical oddities at http://halfelf.org and wrote the sequel to this book: WordPress Multisite 110 Her ebooks can be found on her website as ‘Pay What You Want.’ A five dollar donation is recommended. http://halfelf.org/ebooks/wordpress-multisite-101/ Andrea Rennick (aka andrea_r or sillyandrea) Andrea is a self-proclaimed Mommy Blogger, who learned everything about Multisite back when it was WPMU because she saw a need. Now she’s living the dream, working with WordPress from home for Copyblogger Media, LLC. Of course, Andrea still finds time to help out in the forums and support plugins she and her husband, Ron, provide. Andrea maintains the fabulous resource http://wpmututorials.com

View more...

Comments

Copyright ©2017 KUPDF Inc.
SUPPORT KUPDF