35
& Scott McCollum Extension Information Technology [email protected] | @scottmccollum Mike Vysocka Extension Information Technology [email protected] | @thewebvy

Powering 180+ domains with a single instance of Wordpress (w/o Multi-site)

Embed Size (px)

Citation preview

Page 1: Powering 180+ domains with a single instance of Wordpress (w/o Multi-site)

&

Scott McCollumExtension Information [email protected] | @scottmccollum

Mike VysockaExtension Information Technology

[email protected] | @thewebvy

Page 2: Powering 180+ domains with a single instance of Wordpress (w/o Multi-site)

1997

Through the years ...

2004

Page 3: Powering 180+ domains with a single instance of Wordpress (w/o Multi-site)

2005 2010

Page 4: Powering 180+ domains with a single instance of Wordpress (w/o Multi-site)

2012

Page 5: Powering 180+ domains with a single instance of Wordpress (w/o Multi-site)
Page 6: Powering 180+ domains with a single instance of Wordpress (w/o Multi-site)

● Thousands of pieces of content to move● Update and request new DNS entries● Setup tons of 301 Redirects, RedirectMatch● Actively communicate with users● Provide training for users

Page 7: Powering 180+ domains with a single instance of Wordpress (w/o Multi-site)

What did WordPress give us?

● A real Content Management System● Blogging: Point, Click, Publish● Core Updates● A huge user community ● ...

Page 8: Powering 180+ domains with a single instance of Wordpress (w/o Multi-site)

Could a single Wordpress instance, without any plugins, and just a single theme keep 100+ site owners happy

?

BUT …

and no, we’re not using WordPress MU

Page 9: Powering 180+ domains with a single instance of Wordpress (w/o Multi-site)

YES

Page 10: Powering 180+ domains with a single instance of Wordpress (w/o Multi-site)

184 domains created

strawberries

pender growingsmallfarms

www.ces.ncsu.edu

148 are live today.

mecklenburg

Page 11: Powering 180+ domains with a single instance of Wordpress (w/o Multi-site)

651 usershave published or edited content

19,000 pages/posts currently published

6,500,000 page views since launching July 1, 2012

As of April 2014 ...

Page 12: Powering 180+ domains with a single instance of Wordpress (w/o Multi-site)
Page 13: Powering 180+ domains with a single instance of Wordpress (w/o Multi-site)

October 25, 2013

We went mobile

Page 14: Powering 180+ domains with a single instance of Wordpress (w/o Multi-site)

* .ces.ncsu.edu domainsalamance - alexander - alleghany - als - anr - anson - ashe - avery - beaufort - bertie - bladen - blueberries - brunswick - buncombe - burke - cabarrus - cabbage - caldwell - calsleadership - camden - carteret - caswell - catawba - chatham - cherokee - chowan - clay - cleveland - colecrops - columbus - communitydevelopment - conference - cotton - craven - cucurbits - cumberland - currituck - cutflowers - dare - davidson - davie - duplin - durham - ebci - edgecombe - eggplant - energy - entomology - eod - espanol - evaluation - extensiongardener - fcs - fieldtoschool - floriculture - foodsafety - forsyth - franklin - gardening - gaston - gates - giving - graham - granville - grapes - greene - greenhousecrops - greens - growingsmallfarms - guilford - halifax - harnett - haywood - henderson - hertford - hoke - horticulture - hyde - intranet2 - ipm - iredell - jackson - johnston - jones - lee - lenoir - lettuce - lincoln - localfood - macon - madison - marketingtoolkit - martin - mcdowell - meatgoats - mecklenburg - mitchell - montgomery - moore - nash - nc10percent - ncce100years - ncchoices - nccommunitygardens - ncdisaster - ncstepstohealth - newhanover - northampton - northcentral - northeast - onslow - orange - pamlico - pasquotank - peaches - pender - peppers - perquimans - person - pesticidenews - pitt - plantpathology - poinsettias - polk - postharvest - poultry - poultry4hyouth - randolph - registration - richmond - robeson - rockingham - rootcrops - rowan - rubus - rutherford - sampson - scotland - shellfish - soils - southcentral - southeast - soybeans - spinach - stanly - state - stokes - strawberries - surry - sustainability - swain - sweetpotatoes - therapeutic-hort - tobacco - tomatoes - transylvania - tyrrell - union - vance - vegetables - wake - warren - washington - watauga - wayne - weeds - west - wilkes - wilson - yadkin - yancey

Page 15: Powering 180+ domains with a single instance of Wordpress (w/o Multi-site)

How does it work?

Page 16: Powering 180+ domains with a single instance of Wordpress (w/o Multi-site)

We use all 4th level domainssomeName.ces.ncsu.edusomeOtherName.ces.ncsu.edu... yes, we use 180+ of them.

You could easily do this for your domainmySiteName.myuniv.edumySiteName2.myuniv.edu... ^ and, they don't even have to be fourth level!

Page 17: Powering 180+ domains with a single instance of Wordpress (w/o Multi-site)

Using DNS, every sub-domain is aliased to the same server

Page 18: Powering 180+ domains with a single instance of Wordpress (w/o Multi-site)
Page 19: Powering 180+ domains with a single instance of Wordpress (w/o Multi-site)

http://wolfpack.ces.ncsu.edu

$_SERVER[“HTTP_HOST”]

echo preg_replace(“/\.ces\.ncsu\.edu$/”, ‘’, $_SERVER[“HTTP_HOST”] );// prints “wolfpack”

Page 20: Powering 180+ domains with a single instance of Wordpress (w/o Multi-site)
Page 21: Powering 180+ domains with a single instance of Wordpress (w/o Multi-site)

Keep it simple.Do your best to avoid one-off feature requests, use a common header / footer with only slight variations. Can the code you write be used on 10 or more domains?

Page 22: Powering 180+ domains with a single instance of Wordpress (w/o Multi-site)

lines of code in our theme’s functions.php file handle the edge cases, quirky requests, custom views, and self-imploding ideas our 650+ users have for their 180+ websites

1900

/* and about 15% of those lines are comments! */

Page 23: Powering 180+ domains with a single instance of Wordpress (w/o Multi-site)

Creating a new site is easy.1. We get a DNS entry for the new domaini.e. wolfpack.ces.ncsu.edu

2. We create a Wordpress user named wolfpack, just as you normally would. This creates an entry in wp_users

Page 24: Powering 180+ domains with a single instance of Wordpress (w/o Multi-site)

We use our campus authentication to supersede the native Wordpress login

But you could just as easily use OAuth, LDAP, htaccess, etc.

You could argue, this adds a layer of security.

But really, we're just using it so we can map multiple real users, real people and their logins to a single wordpress user.

Page 25: Powering 180+ domains with a single instance of Wordpress (w/o Multi-site)

3. We create an access table in the Wordpress database that will map organizational userIDs to a particular Wordpress username in the wp_users table.i.e. an email address, eXtensionID, unityID

user_id wp_user_login access_level

[email protected] wolfpack editor

[email protected] sweetpotatoes editor

[email protected] wolfpack admin

Page 26: Powering 180+ domains with a single instance of Wordpress (w/o Multi-site)

Having multiple folks sign in under the wordpress user ‘wolfpack’ makes author

attribution messy.

Use wp_postmeta table

Page 27: Powering 180+ domains with a single instance of Wordpress (w/o Multi-site)

4. Create another custom table with some meta data about each of your sites.

Page 28: Powering 180+ domains with a single instance of Wordpress (w/o Multi-site)

You can choose to leverage Wordpress' wp_usermeta table instead

Page 29: Powering 180+ domains with a single instance of Wordpress (w/o Multi-site)

Use native Wordpress functions (hooks, actions, filters)

● get_post_meta()● get_author_meta()● get_posts($args)● get_usermeta()

Or write your own ...● __get_site_type()● __get_site_name()● __get_author_ldap()

Page 30: Powering 180+ domains with a single instance of Wordpress (w/o Multi-site)

portal

county

county

if($siteType == ‘portal’){

get_full_banner();

}elseif($siteType == ‘county’){

get_color_block();get_small_banner();

}

1 theme, and a few small tweaks

the codethe visual

Page 31: Powering 180+ domains with a single instance of Wordpress (w/o Multi-site)

We put every WordPress author on an island

Page 32: Powering 180+ domains with a single instance of Wordpress (w/o Multi-site)

Use Wordpress' built-in filters and actions behind the scenes

Page 33: Powering 180+ domains with a single instance of Wordpress (w/o Multi-site)
Page 34: Powering 180+ domains with a single instance of Wordpress (w/o Multi-site)

● Centralized Google Analytics● Content Sharing● Content QA● Faster Feature Rollouts● Wider, Faster A/B Split Tests● Easier Access Control● One Stop Publishing

BIG Benefits to being under the same umbrella

Page 35: Powering 180+ domains with a single instance of Wordpress (w/o Multi-site)

Link to these slides:go.ncsu.edu/wordpress

How did we do?joind.in/9879