Make Network WordPress Private Site Wide

I am creating an Intranet wordPress site for the company that I work for. It has different sections for each part of the company. When you login to the site it will show you everything that you have access to, Graphs, Charts, Personal To Do’s. This is all using WordPress Multi Network, and it is slowly coming along and now I wanted to make it private. This is a two fold thing, We want you to be logged in to view whats going on, and we don’t want any outsiders seeing what we are doing. I could put this on a computer her in the office and host it internally, but thats no fun, We have a lot of satellite working and are often working off our devices. So thats why i made it possible to access anywhere.

Anyways, We wanted to make it so you had to login to be able to see anything. Essentially making it private. Luckily there is already a plugin out there and it is very small, and works magical to our needs, Private WP. But then I have to add it to every blog we have and activate it. But thankfully wordPress is smart and made a mu-plugins folder in wp-content. Whatever plugin you add in there gets activated and added to every blog in your install.
Make Network WordPress Private Site Wide

All you have to do is download the plugin and upload it to that folder and it is activated site wide.

This is the plugin, which is exactly how I would have done it.


function private_wp() {
if (!is_user_logged_in()) {
auth_redirect();
}
}

add_action('get_header', 'private_wp');

About Weston Deboer

I like to use wordpress for any and every website that I work on. No matter how big or how small the website is.
This entry was posted in Wordpress. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>