How to Protect a Page with a Password in Joomla?

Sometimes you have an important page that you don’t want every visitor to your website to have access to. The first thing that comes to your mind is to make this page only accessible by members, but you then realize that you don’t want all your members to have access to this page. Just a few members. So you need an extra level of security on that page. That extra level of security means protecting the page with a password.

So, how do you protect a Joomla article (or any other page for that matter) with a password?

Well, there are two ways: An easy, non technical way, and a not-so easy, and somehow technical way:

The easy way:

  • Download the Joomla plugin called “ContentPassword” from here.
  • Install it by logging in to your Joomla admin, and clicking on Extensions->Install/Uninstall, and then choosing the plugin from your hard drive and installing it.
  • Follow the instructions to protect your articles.

The hard way:

  • Download Jumi (a Joomla extension that will let you embed PHP code into your articles)
  • Create a Jumi module that will redirect the visitor to a PHP form on your website asking for a password. Once the user enters the password, then see if the password matches the one in your Jumi code. If it doesn’t, then ask for the password again, if it does, then store a “logged-in” state in the session and redirect back to the page (Your Jumi should no longer block the page since the user has entered the correct password).
  • Add the Jumi module to the article that you wish to protect.
  • Create other Jumis if you want to password-protect pages with different passwords.

It’s obvious to see that the first way of doing it is much more elegant than the second way, but for your convenience, we just listed both anyway.

If you need help protecting your Joomla pages with a password, then feel free to contact us. We’re always ready to help, and our customers love us!

One Response to “How to Protect a Page with a Password in Joomla?”
  1. Comment by jkarretero — February 9, 2012 @ 7:41 am

    There is an easy way that doesn’t ask for the password again, storing a ‘logged-in’ state in the session.

    Just activate following option:

    Extensions > Plugin manager > Content – ContentPassword > Plugin parameters > Use Session > Yes

Leave a comment