If you are doing research because you need to build an Intranet site and are not sure of what platform to use then stick around, In this tutorial, I’ll try to give you an idea how to build an Intranet site using WordPress. Most people on the Internet recommend using Drupal, Joomla or any other CMS to build Intranets but they seldom recommend WordPress, because WordPress is mostly used for building blogs or light websites. We built an Intranet site a few years ago at my workplace using Drupal, and it does the job, but the cost of building it was high ( consultant work ) and the maintenance to keep it running ( upgrades, etc. ) is also costly. Drupal has a steeper learning curve than WordPress I believe so consultants tend to charge more for doing work on Drupal than WordPress – that’s base on my experience, your mileage may vary.
Table of Contents
Our Intranet doesn’t have anything out of the ordinary. Things we use it for are:
- Company policies publication
- Company news updates
- Employee directory
- Event calendar
- Important links to other resources
- A photo gallery ( for photo sharing, etc. )
Could we have built our Intranet site using WordPress instead of Drupal and have those same features? You bet! And the cost would have been much lower I think. WordPress is so popular and so huge that anything you can think of building a website has already been built with WordPress by either using the WordPress core features or through a plugin. There is gazillion of WordPress plugins available that you will hardly need to touch a line of code to build a simple Intranet like the one we have.
WordPress Permissions Limitation
The only limitation I’ve found on WordPress so far is user permissions. At least out of the box WordPress only can handle the following “Roles”:
- Administrator – can do anything on the backend or frontend of the site.
- Editor – Can manage and publish content.
- Author – Can read everything on the site and publish their own content.
- Contributor – Can write posts but cannot publish them. Instead, their posts are submitted for review.
- Subscriber – Has basic functionality such as changing their profile and leaving comments.
For our simple Intranet site, these roles are enough. We only have a few people with editor and administrator roles ( to manage the site ) and the rest of the employees get “Author” roles so they can access everything on the site and publish their own content if they like. We have a separate Document Management System (DMS ) so we don’t do document access permissions on the Intranet, our DMS takes care of that.
Intranet Site Navigational Structure
The reason why many people think WordPress is not suitable for building Intranets and other more traditional websites is that of the “blog” feeling it has out of the box. And yes, WordPress out of the box looks like most of the blogs you may visit every day, but you can change the WordPress structure and design very easily. One of the first things you need to think about before starting building your Intranet is the navigation structure of the site.
I’m not the best drawer in the world, but here is a quick sample of the most common navigational structure used on Intranets:
Think or brainstorm about the structure of your Intranet site before even thinking about the design and look. having a very clear picture of your site structure will save you a lot of headaches when you get to the building process.
Starting The Building Process
So how do I get started building the damn thing you might be asking? Well, first thing first, right? you need to install WordPress. Taking into account this is an Intranet site which most likely will only be accessible to company employees, I assume you will be hosting the site in your private network, and have a dedicated server for it. I recommend using Ubuntu Server to host your site. Here are two tutorials I wrote a while ago to help you get to the point of having WordPress up and running quickly:
Once you get a vanilla WordPress instance up and running, start getting familiar with the WordPress Menu Structure under Appearance > Menu that’s where you will set the navigational structure for your site. Your backend Menu Structure should look like this:
And your front end Menu should look like this:
You can add either Pages or Categories as Menu or Sub-Menu. It only took me about 10 minutes to setup this DEMO site using the first free WordPress theme I found. You can search hundreds of themes in the WordPress Theme directory https://wordpress.org/themes/
Making your Intranet Site password protected
Now I’m sure you only want your employees accessing your Intranet site, so we need to password protect it. In order to do that, we’ll force WordPress to ask for login credentials when someone tries to access the site. We’ll do that using this plugin https://wordpress.org/plugins/wp-force-login/ you can search for that plugin from the plugin section in WordPress too:
Once you activate the plugin you will be redirected to the WordPress login page if you try to access the site:
Now we need to get rid of all those WordPress default settings and links i.e. “Lost your password”.. you don’t want your users resetting their password from your WordPress site, unless you are planning to use WordPress to manage the user accounts, I think it will be better to use LDAP to do that ( I’ll give you the instructions below how to do that )
To customize the WordPress login Page add the following code at the bottom of your “functions.php” theme file. to do that click on Appearance and then click on Editor :
and then click on your “Theme Functions” file:
and finally add this code at the very bottom of the function theme file:
//* Add custom message to WordPress login page
function smallenvelop_login_message( $message ) {
if ( empty($message) ){
return "Please use your Username (i.e. jsmith ) and password to login. If you don’t have a Network account, please contact IT.
";
} else {
return $message;
}
}
add_filter( 'login_message', 'smallenvelop_login_message' );
function remove_lostpassword_text ( $text ) {
if ($text == 'Lost your password?'){$text = '';}
return $text;
}
add_filter( 'gettext', 'remove_lostpassword_text' );
remove_filter( 'authenticate', 'wp_authenticate_email_password', 20 );
add_filter( 'gettext', 'register_text' );
add_filter( 'ngettext', 'register_text' );
function register_text( $translated ) {
$translated = str_ireplace( 'Username or Email Address', 'Network Username', $translated );
return $translated;
}
function custom_loginlogo() {
echo '';
}
add_action('login_head', 'custom_loginlogo');
add_filter( 'login_headerurl', 'custom_loginlogo_url' );
function custom_loginlogo_url($url) {
return 'http://www.domainURL.com';
}
add_action( 'login_head', 'hide_login_nav' );
function hide_login_nav()
{
?>
remove_node( 'wp-logo' );
}
add_action('after_setup_theme', 'remove_admin_bar');
function remove_admin_bar() {
if (!current_user_can('administrator') && !is_admin()) {
show_admin_bar(false);
}
}
After you do that, your WordPress login page should look like this:
All WordPress related settings should be gone. Remember to upload your company logo image to your theme directory i.e “images/logo.png”
Integrating your WordPress Intranet Site with LDAP
The last thing we will do is to integrate our Intranet site with LDAP. Install the “Active Directory Integration / LDAP Integration” from the plugin directory in your Site or download it from here https://wordpress.org/plugins/ldap-login-for-intranet-sites/ Once you have installed and activated the plugin, go to the “LDAP Configuration” tab:
and make sure the following settings are checked:
- Enable LDAP login
- Authenticate Administrators from both LDAP and WordPress
- Enable Auto Registering users if they do not exist in WordPress
and enter your LDAP information. For Example, mine looks like this:
- *LDAP Server: ldap://192.168.100.191:389
- *Service Account DN: CN=Nelson Amaya,OU=Users,DC=Ittutorials,DC=net
- Service Account Password: the password for the above account
- *Search Base(s): DC=ittutorials,DC=net
- *LDAP Search Filter: (&(objectClass=*)(sAMAccountName=?))
After you have entered that information save it, and then try to login with an LDAP account. it should work. to Define the roles you want to be set for people logging in to your Intranet site, go to the “Role Mapping” Tab and fiddle with the settings there.
Conclusion
If you read up to this point, I hope you got a pretty good idea how to get started building your Intranet site using WordPress. Depending on your company size and the needs you have, building an Intranet site is a huge undertaking and there are so many things I didn’t touch on in this tutorial.