Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Best Friend || Worst Enemy: WordPress Multisite

1,547 views

Published on

“We’ve all built a ton of WordPress sites. We’ve also managed them all too. You’ve probably heard about WordPress Multisite Networks, and all the awesome things it can (and can’t) allow you to do.

With great power, comes great responsibility. During this talk, Taylor will step through the do’s and don’ts of Multisite Networks. He will share how WordPress Multisite can be your best friend or worst enemy… but usually both… at the same time.”

Learning Outcomes:

Expect pro-tips, eureka moments, and hard lessons learned from his experience setting up and running multisite networks for small private company intranets, all the way to global enterprise brands.

By the end of this talk you will know the pros and cons of WordPress Multisite Networks, best practices for setting up and running a multisite, and know about alternatives if multisite isn’t a fit for your next project.

Presented by Taylor McCaslin at WordCamp Toronto on October 3, 2015.

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Best Friend || Worst Enemy: WordPress Multisite

  1. 1. @Taylor4484 #multisite #WCTO Best Friend || Worst Enemy Multisite Network Do’s & Don’ts presented by Taylor McCaslin at WordCamp Toronto on October 3, 2015
  2. 2. @Taylor4484 #multisite #WCTO @Taylor4484 #multisite (follow me for the link to these slides & tweet your photos!)
  3. 3. @Taylor4484 #multisite #WCTO Technical Product Manager UX Designer Interaction Designer BA, Theatre & Dance Certificates in Business, Computer Science, Digital Art & Media Taylor McCaslin
  4. 4. @Taylor4484 #multisite #WCTO Disclaimer ● My advice is based on my experience with what has worked for me in the past ● Every project is unique ● There is an exception to every rule I makeup ● Plugins will do everything I say multisite won’t or shouldn’t
  5. 5. @Taylor4484 #multisite #WCTO What people are saying ● “I tried to use multisite to manage multiple sites and just got myself confused” ● “Multisite is amazing, why would anyone not use it?” ● “Multisite is hard” ● “We had a project that was running multisite and we converted it to a standard wordpress install” ● “I don’t use anything but multisite”
  6. 6. @Taylor4484 #multisite #WCTO How it’s being used “Multisite is now a utility for managing multiple sites using one installation, where as the original vision was to enable blogging networks“ @jjj on make.wordpress.org/core
  7. 7. ● ○ Multisite
  8. 8. ● ○ Best Friend || Worst Enemy
  9. 9. @Taylor4484 #multisite #WCTO What is Multisite? ● A multisite network is a collection of site that all share the same single WordPress installation ● Terminology ○ Install: an instance or installation of WordPress ○ Network: a set of subsites that operate within the single WordPress install configured for multisite ○ Site: one of the subsites in the multisite network
  10. 10. @Taylor4484 #multisite #WCTO What ISN’T Multisite? ● A network of sites that can be moved to separate hosts ○ 1 host. 1 install of WordPress. Many sites. ● A set of sites that can easily be separated into their own WordPress installs ○ trust me, modifying serialized data is not fun ● A set of sites that can have different IP addresses ○ see the first point
  11. 11. @Taylor4484 #multisite #WCTO A big happy multisite apartment Multisite networks are like apartment complexes. ● Shared roof (hosting) ● Common spaces (filesystem) ● Private apartments (sites) Be a good neighbor Don’t trust strangers! Always Lock your apartment door
  12. 12. @Taylor4484 #multisite #WCTO The Network Admin /wp-admin/network
  13. 13. @Taylor4484 #multisite #WCTO Open or Closed Site? ● Terminology is hard…. and confusing Public Network / Untrusted ● Anyone can signup and create a site (sometimes paid) ○ WordPress.com ○ Happytables.com ○ University Student Blogs ● Concerns: ○ file types / uploads ○ scripts / embeds ○ copyright / DMCA Private Network / Trusted ● Limited site and user creation ○ Wordcamp.org ○ Company intranets ○ University network ■ colleges ,department, etc ● Concerns: ○ too many cooks ○ or none at all ○ code changes affect all sites!
  14. 14. @Taylor4484 #multisite #WCTO Subfolders, Subdomains, & Domain Mapping ● 1 primary network domain ○ sub-domain (I prefer this one) ■ mysite.com ■ site2.mysite.com ■ site3.mysite.com ○ sub-folder ■ mysite.com/site1 ■ mysite.com/site2 ■ mysite.com/site3 ● Domain Mapping ○ Github.com/humanmade/Mercator ■ sunrise.php ○ Premium plugins exist for selling domains to users (wpmudev.org)
  15. 15. @Taylor4484 #multisite #WCTO ALWAYS use CNAMES
  16. 16. @Taylor4484 #multisite #WCTO Unified Site Management ● Super Admin Role ● manage_network ● manage_sites ● manage_network_users ● manage_network_plugins ● manage_network_themes ● manage_network_options ● unfiltered_html codex.wordpress.org/Roles_and_Capabilities
  17. 17. @Taylor4484 #multisite #WCTO Shared Users ● All blogs have central user management ● Users login once to access all sites on the network ○ Doesn’t play well with 2FA plugins ■ You’ll login for every site ■ Duo2, Google Auth, Two Factor Auth, etc
  18. 18. @Taylor4484 #multisite #WCTO Shared Users ● Caution: User profiles are the same for all sites
  19. 19. @Taylor4484 #multisite #WCTO Individual Multisite Author
  20. 20. @Taylor4484 #multisite #WCTO Shared Themes ● Add a theme ○ Network Enable (all sites) ○ Restrict themes available to use per site ■ Done through the Site -> Edit Site menu in network admin ● Changes to one theme WILL affect all sites using it
  21. 21. @Taylor4484 #multisite #WCTO Child Themes on Multisite https://wordpress.org/plugins/one-click-child-theme/
  22. 22. @Taylor4484 #multisite #WCTO Shared Plugins ● Install plugins on the network (for your site admins) ○ Activate per site (wp-admin) ○ Network Activate (network admin) ● Must Use Plugins ○ Can’t be deactivated through the admin
  23. 23. @Taylor4484 #multisite #WCTO Settings in two places...
  24. 24. @Taylor4484 #multisite #WCTO File Structure Differences ❏ wp-config.php has extra lines ❏ .htaccess has extra lines ❏ wp-content/sunrise.php if you are using domain mapping ❏ wp-content has extra subfolders
  25. 25. @Taylor4484 #multisite #WCTO File Structure Differences Pro tip: rely on host to allow you to grant your site admins access to only specific site directories
  26. 26. @Taylor4484 #multisite #WCTO DB Structure Differences Normal WordPress (10) wp_options wp_posts wp_postmeta wp_comments wp_commentmeta wp_terms wp_term_taxonomy wp_term_relationships wp_users* wp_usermeta* Multisite Specific (10 + 6) wp_blogs wp_blog_versions wp_registration_log wp_signups wp_site wp_sitemeta PER Multisite (10 + 6 + (N * 8)) wp_2_options wp_2_posts wp_2_postmeta wp_2_comments wp_2_commentmeta wp_2_terms wp_2_term_taxonomy wp_2_term_relationships
  27. 27. @Taylor4484 #multisite #WCTO Tables in ONE multisite DB (10 + 6 + (N * 8)) where n is number of sites 1 site = 24 tables 10 sites = 96 tables 100 sites = 816 tables 1,000 sites = 8,016 tables 10,000 sites = 80,016 tables 95,000,000 sites = 296,000,016 tables WordPress.com, July 2015
  28. 28. @Taylor4484 #multisite #WCTO Choosing the right Hosting ● Use a managed host ● Pro-Tips: ○ automatic backups with 1 click restore (ability to download backup) ○ built in staging sites (that magically with the networked sites) ○ granular deploy to production controls (deploy only specific tables) ○ look for extra security features (like automatic ip blacklisting) ○ know limitations (some hosts don’t allow subdomains or subfolders) ○ use version control ● MMSN (massive multisite network) ○ plan to spend $$$$ or hire a sysadmin
  29. 29. @Taylor4484 #multisite #WCTO Pro Dev Do’s ● define('DISALLOW_FILE_EDIT', true); ○ disable the Admin File Editor ● define( 'DO_NOT_UPGRADE_GLOBAL_TABLES', true ); ○ For large sites: prevents dbDelta() and the upgrade functions from doing expensive queries against global tables
  30. 30. @Taylor4484 #multisite #WCTO Multisite Plugin Developer Do’s ● Consider your Network and WP-Admin settings ○ Split out these settings if needed ● Cleanup site options on delete ○ delete_site_option( $option_name ); ○ can be expensive ● Cleanup custom site tables on delete ● Consider how licensing will work for Networks
  31. 31. @Taylor4484 #multisite #WCTO Pro Dev Do’s ● add_action( ‘network_admin_menu’, ‘my-settings’ ); ○ add extra submenus and menu options to the network admin panel'
  32. 32. @Taylor4484 #multisite #WCTO Multisite Theme Developers Do’s ● Create Child Themes for your Themes ● Consider how licensing will work for Networks
  33. 33. @Taylor4484 #multisite #WCTO Pro Dev Dont’s ● current_user_can(‘unfiltered_html’) ○ “Allows user to post HTML markup or even JavaScript code in pages, posts, comments and widgets.” ○ Just don’t. You will regret this. ● loop through your network sites ○ Unless you know what you’re doing, you’ll cripple your site performance, if not crashing your site altogether.
  34. 34. @Taylor4484 #multisite #WCTO Multisite Use Cases
  35. 35. @Taylor4484 #multisite #WCTO To multisite or not? “I want to allow users to create their own sites within a network with some constraints”
  36. 36. @Taylor4484 #multisite #WCTO To multisite or not? “I want to allow users to create their own sites within a network with some constraints” ● Use Multisite! ○ This is what multisite was made to do, and it does it well! ● Pro-Tip: customize the admin! ○ WordPress.com ○ Happytables.com
  37. 37. @Taylor4484 #multisite #WCTO Happy Tables Custom WP Admin
  38. 38. @Taylor4484 #multisite #WCTO To multisite or not? “I want to centrally manage all my client’s sites”
  39. 39. @Taylor4484 #multisite #WCTO To multisite or not? “I want to centrally manage all my client’s sites” ● Don’t use Multisite ● Alternatives: ○ Jetpack Site Management (update plugins across your site) ○ WP Remote (free, hosted) ○ Manage WP (premium, hosted) ○ Infinite WP (free, self-hosted with paid addons) ○ WP-CLI (script your way to site nirvana)
  40. 40. @Taylor4484 #multisite #WCTO To multisite or not? “I want to have a multisite network where each site is in a different language”
  41. 41. @Taylor4484 #multisite #WCTO To multisite or not? “I want to have a multisite network where each site is in a different language” ● Maybe Multisite, Maybe Not ● SEO optimization can be difficult when similar content is across a network of sites ○ Pro-tip: hreflang tags and canonical links are your friend ● Plugins like WPML are built specifically to do this
  42. 42. @Taylor4484 #multisite #WCTO To multisite or not? “I have a lot of content that is very different, and I want all my sites to look different, but it’s still all my content”
  43. 43. @Taylor4484 #multisite #WCTO To multisite or not? “I have a lot of content that is very different, and I want all my sites to look different, but it’s still all my stuff” ● Most likely not Multisite, but maybe ● Map domains to categories and tags ● Create custom templates for custom posts types, and category archives
  44. 44. @Taylor4484 #multisite #WCTO Best Friend || Worst Enemy Multisite Network Do’s & Don’ts presented by Taylor McCaslin at WordCamp Toronto on October 3, 2015

×