Tuesday, March 26, 2013

A Network of Websites Using WordPress Multisite

WordPress Multisite is a characteristic that since WordPress type 3 has been encompassed discreetly right into the establish itself. It is a feature that loads a gigantic hit, permitting 1000s of blogs to live effectively inside one, lone WordPress install. It is a large idea for large-scale sites that use multiple sub-domains, blog systems, social systems, or even interior networking for enterprises or organizations. While this characteristic has been around for nearly as long as WordPress itself, it is just now getting the vigilance it deserves – even from WordPress devs.

By the end of this tutorial series, you should be exceedingly familiar with what WordPress MS is, how to install it, how to conceive new sites, and how to use it most competently for your next task.

What precisely is WordPress MS?
In a nutshell, Multisite enables a lone WordPress install to proceed like a network of sites centralised round a single domain (http://yoursite.com). It permits for either new sub-domains (http://subdomain.yoursite.com) or sub-directories (http://yoursite.com/subdomain), and it does all this effectively, which means you do not need to create new folders. Instead, by just supplementing some code to wp-config.php and .htaccess, you have thousands of sites right at your fingertips.

Multisite furthermore allows for easy mesh administration through a single admin dashboard which a client with befitting permissions can get access to by any network site’s admin bar. Multisite is by no means “new”. It has been round for nearly as long as WordPress itself, although before it was evolved individually. Since WP 3.0 it has been encompassed simultaneously with WordPress, and, as I mentioned above, it seems like it will only get more user-friendly as the WordPress devs seem to be giving some particular vigilance to it in 2012.

Next, let’s look at installing Multisite on a usual WordPress establish.

establishing WordPress Multisite
For many persons, installing Multisite can be a nightmare. I hope to alleviate that by taking you step-by-step through both a sub-directory and sub-domain establish. Let me state first, that it is by far easier to establish Multisite on a new establish, even though it is still likely to do it on an older establish with pre-existing content. although, there could possibly be permalink matters.

With that said, the following steps assume that you have accomplished a benchmark establish of WordPress. However, the steps can request to a new or previous establish.

triggering the Network Setup Menu piece
In alignment to even start the method of installing Multisite, you need to open your wp-config.php document, and right overhead 

/* That's all, stop editing! Happy blogging. */

add the following:

/** Allow Multisite **/

define('WP_ALLOW_MULTISITE', true);

The first line simply is a comment that will help us keep our code tidy. Next, we tell our WordPress install to allow Multisite functionality. Once you have edited and saved the file, you should now see the following in your “Tools” submenu:
From this screen, you have the following items to configure:
  • Site Addresses – From here you will select whether to use sub-domains or sub-directories. If you choose to work with sub-domains, you should verify with your host if it is possible.
  • Network Title – The title for your network.
  • Admin E-Mail Address – The admin contact for your new network.
  • The server address should already be filled in to display how your new permalinks will appear.
Finishing the Multisite Install
Now, let’s look step-by-step at the instructions given on the “Enabling the Network” page. Before you dig into this, I would strongly suggest that you backup your wp-config.php and .htaccess files. This will save a lot of headache in the future.

Create a new directory named blogs.dir, and place that in your root folder’s wp-content folder. This folder must be writable by the web server, as it will be used to store all of our network’s uploaded media.

Add the following code for a subdomain install:

    define( 'SUBDOMAIN_INSTALL', true );
    $base = '/';
    define( 'DOMAIN_CURRENT_SITE', 'yoursite.com' );
    define( 'PATH_CURRENT_SITE', '/' );
    define( 'SITE_ID_CURRENT_SITE', 1 );
    define( 'BLOG_ID_CURRENT_SITE', 1 );



and this for a sub-directory install


    define( 'MULTISITE', true );
    define( 'SUBDOMAIN_INSTALL', false );
    $base = '/';
    define( 'DOMAIN_CURRENT_SITE', 'yoursite.com' );
    define( 'PATH_CURRENT_SITE', '/' );
    define( 'SITE_ID_CURRENT_SITE', 1 );
    define( 'BLOG_ID_CURRENT_SITE', 1 );



Make sure to change yoursite.com to the URL of your site – make sure it is without WWW. Broken down, this code identifies this as a sub-domain or sub-directory install, and sets your main site’s ID as Every site has an ID, and it is important to note these as you start to work with plugins and build custom queries.

Add the authentication keys provided to wp-config.php. This will help secure your install.

Finally, you want to add the following code to your .htaccess file:


        RewriteEngine On
        RewriteBase /
        RewriteRule ^index\.php$ - [L]
       
        # uploaded files
        RewriteRule ^files/(.+) wp-includes/ms-files.php?file=$1 [L]
       
        RewriteCond %{REQUEST_FILENAME} -f [OR]
        RewriteCond %{REQUEST_FILENAME} -d
        RewriteRule ^ - [L]
        RewriteRule . index.php [L]



This code will replace any other WordPress code that you find in .htaccess.

For another reference on setting up a WordPress Multisite network, be sure to visit the “Create a Network of WordPress Sites” page in the Codex.








Things to Note with Multisite Installs

    Multisite is easiest to install on a fresh WordPress install with the sites as sub-directories. That isn’t to say don’t install it any other way, just to point out the easiest path.
    If you use Multisite, then you can not give WordPress it’s own folder. It must be installed in the root folder of your site.
    Editor’s Note: This is not 100% correct, for further information and clarification, see Andrea_R’s comment below.
    Your web host may not allow for the creation of sub-domains. Be sure to check this out before attempting a sub-domain install.
    You must activate the network feature from the WordPress dashboard. Simply adding the code to wp-config.php and .htaccess is not enough.

Navigating the Network Admin

In order to access the Multisite admin dashboard in WordPress 3.0 and later, simply hover over My Sites in the admin bar at the top of the browser window, and click on Network Admin.

Once in the dashboard, the menu looks like this:

The Network Admin menu has the following submenus:

    Sites – From here you can create new network sites, visit admin dashboards, delete sites, and edit site settings.
    Users – This submenu allows you to manage users by creating, editing, and deleting them. You can also see which users have registered on specific sites.
    Themes – With Multisite, themes are managed from the network. Themes must be installed, activated, and edited from within the network admin dashboard. They can still be switched in the site dashboard.
    Plugins – Just like themes, plugins are installed and activated on the network from this dashboard. Plugins can still be activated and set up in the site dashboard.
    Settings – This submenu lets you set the network name, admin email, registration settings, welcome emails, initial site settings, and upload settings. This is a great submenu to configure if you are using Multisite as a blog engine or social network.
    Updates – From this submenu, you can do network-wide updates on WordPress core, plugins, and themes.

Next, I want to walk you through creating your first network site. If you are familiar with using WordPress, everything else should seem pretty normal, with the exception of having to go through a network dashboard to activate plugins and themes instead of a normal site dashboard.
Creating a New Site

    From the network dashboard, navigate to Sites –> Add New.
    Next, you will need to specify the site address, site title, and an admin email. The screen will look like this:
    Once added, you will see a message at the top verifying the site’s creation. You can now visit the site’s dashboard, or edit the site’s settings from the network dashboard. Two emails will also be sent. Once will go to the network’s overall admin notifying them of the new site, and one will go to the site’s new admin, notifying them of their login credentials.

And that’s how easy creating sites can be in WordPress MS! Now, let’s look at some plugins.
Indispensable Plugins for WordPress MS

Here is a list of some plugins that I suggest using on MS installs, and, as always, if you have others to add throw them in!

    WordPress MU Sitewide Tags Pages

    This plugin allows you to create a specific blog on the network where ALL recent posts on the network can be found. From within the plugin, you can also specify this to be on the main site that you set up in the initial Multisite install. The max number of posts to display can be set as well.
  
Multipost MU / ThreeWP Broadcast

    This plugin allows users that create content on different blogs to "broadcast" their posts to other blogs on the network. In addition to post content, categories, tags, and custom fields can also be broadcasted. To ease publishing to multiple blogs, blog groups can be created.
    More Privacy Options

    This plugin allows you to set the privacy level of each blog from within the network dashboard site’s settings panel. The options are:
    Domain Mapping

    This plugin allows users to use their own domain names on your Multisite network. This plugin does require a knowledge of adding and editing plugin files and a basic understanding of how servers work and your specific server settings. A great tutorial for setting up this plugin can be found on Otto’s blog, “WordPress 3.0 Multisite Domain Mapping Tutorial“.
    Multisite User Management

    This plugin allows admins to set the default role of each, individual network blog. Once activated, a list of blogs appears on the network settings page. This plugin is different than the New Blog Defaults plugin, as it targets the individual sites as opposed to every new blog. For instance, if you want one site to allow all default users editor capabilities and another to have subscriber capabilities, then this is the plugin you are looking for.
    New Blog Defaults

    This plugin creates defaults for any new blog created on the network. Once activated, a new menu appears under the network Settings submenu. From here, you can edit any of the normal WordPress settings: general blog settings, reading settings, writing settings, permalink settings, discussion settings, privacy settings, and media settings. You can also choose a site’s default theme, and set other options like categories, links, and initial user settings.
    Extended Super Admins

    This plugin allows for the creation of specific user classes with specific roles. The plugin, once activated, can be found under the main network Settings submenu. The capabilities list is extensive.
   

0 comments:

Post a Comment