Smart Passworded Pages
The Smart Passworded Pages plugin enhances WordPress by allowing the creation of central login pages that grant access to any number of passworded child pages. In this fashion you can give each client/member/organization a central place to enter a password and they will be taken to the page that has only their information.
The password field is displayed as a field followed by a button with customizable text. The form is can be uniquely stylized with CSS. The child pages can in turn link to other pages protected with the same password and the password will not need to be re-entered.
To add the password field to a parent page, simply enter the short code
[smartpwpages]
If you wish to assign a unique label to the submit button or give the form a unique ID for CSS identification, the attributes in the following example can be used:
[smartpwpages label=”Login” ID=”sppForm1”]
This plugin doesn’t add the ability to add passwords to pages. WordPress has that built in. On the right hand side of the page editing screen in WordPress, you can change the visibility to Password protected and enter in a password. If you are unfamiliar with using passwords in WordPress, you might want to read this page first: https://codex.wordpress.org/Using_Password_Protection
This plugin does make the password handling smarter and enhances it so that you can enter one password on a parent page and gain access to all the children pages using that password. If you don’t know what children pages or sub-pages are, you might want to read about it here: https://codex.wordpress.org/Pages#Creating_Pages
You can find out more about the Smart Passworded Pages plugin here: http://thecodecave.com/smart-passworded-pages-plugin/
Download
Latest version: Download Smart Passworded Pages v2.0.0 [zip]
Installation
Extract the zip file and just drop the contents in the wp-content/plugins/ directory of your WordPress installation and then activate the Plugin from Plugins page.
FAQ
Q. Installation Instructions
A. Extract the zip file and just drop the contents in the wp-content/plugins/ directory of your WordPress installation and then activate the Plugin from Plugins page.
Q. There’s no dashboard page for this plugin. Is it working? What do I do now?
A. There’s no need for options, just create a parent page that is NOT passworded and include the shotcode somewhere in the text: [smartpwpages]
Then create child pages that ARE password protected using the normal WordPress process for adding a password. It’s that simple. The user will be taken to the first passworded child page that matches the password the reader entered.
If you don’t know what children pages or sub-pages are, you might want to read about it here: https://codex.wordpress.org/Pages#Creating_Pages
Q. Your documentation doesn’t say how to enter the password into your plugin. How do you do it?
A. This plugin doesn’t add the ability to add passwords to pages. WordPress already has that built in. On the right hand side of the page editing screen in WordPress, near the top, you can change the ”Visibility” value to “Password protected” and enter a password into the field that appears. Remember! Do this only for the child pages and not the parent pages!
If you are unfamiliar with using passwords in WordPress, you might want to read this page first: https://codex.wordpress.org/Using_Password_Protection
Q. I get a password prompt when I visit my page. I enter the password, then I see my page with the password prompt on it. What’s up with that?!?
A. You’ve password protected the parent page. Remember, you WANT people to see the page with the smart password prompt. Remove the password from that page and you’ll be fine.
Q. Can I put the smart password prompt in a sidebar or on the home page?
A. Yes, as of version 2.0. You still have to create a parent page and password protect the child pages. Then you can specify the ID of the parent page in the prompt.
In this fashion, you can create a central password page, or widget that takes you to multiple locations.
Here is an example of the contents of such a widget or page…
View Scores:
[smartpwpages parent=”491” label=”Enter Team PW:” ID=”uniqueName1”]
View Team Notes:
[smartpwpages parent=”507” label=”Enter Team PW:” ID=”uniqueName2”]
Q. Can I style my password prompts or the wrong password error?
A. Of course! You can even use the ID parameter on the short code change the ID of each entry form you use and make custom CSS for each.
Here is an example of some CSS that makes the entry field, button and password error message all really ugly…
(!! NOTE: There are slashes in the following text to make it appear correctly online. Do not include the slashes () in your css file !!)
p#smartPWError {
border: 4px solid red;
width: 258px;
padding: 5px;
background-color: aqua;
font-weight: bolder;
}
#smartPWLogin input[type=”submit”] {
background-color: coral;
color: navy;
font-size: large;
}
input#smartPassword {
display: block;
background-color: yellowgreen;
color: cadetblue;
margin-bottom: 12px;
}
Changelog
2.0
- Updated to current version of WordPress
- Addressed FAQs
- Added ability to specify the parent form in the short code
- Escaped some variables to make the shortcode more secure
1.1.7
- Fixed another warning.
1.1.6
- Fixed several warnings and possible version compatibility issues.
1.1.5
- Fixed an error on the Invalid Password response
1.1.4
- Updated header to 3.8.1 compatibility
- Improved documentation
- NOTE: Released on the same day 1.1.3 was publicly checked in. This made 3.6+ compatibility universally available.
1.1.3
- Added 3.6 compatiblity
- Improved internationalization
- Added support for plugins that replace the default hashing protocol
1.1.2
- Tweeked the Exclude Pages plugin compatibilty
1.1.1
- The version labeled 1.1.0 hadn’t included my final fixes and did not work actually work with 3.4. 1.1.1 simply includes the code that was intended to be 1.1.0.
- Updated the styling of the changelog section of the readme file to allow it to parse correctly on WordPress.org
1.1.0
- Updated the plugin to include the security enhancements added in WordPress 3.4
1.0.1
- Added compatiblity with the exclude pages plugin
1.0
- Initial Release
Right… but how do you SET the password? Pretty crucial detail, ain’t it?
I can not find the instructions on how to set the password(s).
Hi Jay, The setting of the password is doing right from within the WordPress post itself. You can read about that here: http://codex.wordpress.org/Content_Visibility#Setting_Page_and_Post_Visibility
I’ve been looking for 30 minutes for this answer. Please record a 30 second video clip doing this, and then use Annotations and put a hyperlink to the new video from the end of your old video. Thanks. Great plug-in. Does exactly what I need it to do. Just painful trying to find where to set the password.
Hi Brian, love your plugin–thanks so much for sharing it! I’m not sure if I’m doing something wrong as when I move from the password protected area of my site back into the public area and then try to access the protected area again, I have to re-enter the password all the time. Do you know if this has something to do with how I’ve set it up? I have pasted the code [smartpwpages] into the parent page and password-protected its child pages–it works fine except for having to re-enter the password to go back into the protected area any time I move out of it. I notice on your example it doesn’t ask for the password again so I must be doing something wrong?
Sharon, it should just work, but if you have cookies turned off, it will force you to log back in again. Could that be the issue? You could contact me by sending me an email at brian at this website if you like..
Hi Brian, I thought this plugin might work as a landing page for clients to type in their password,
which would take them to a page/gallery with the info I want them to see.
I have a web client who is a photographer, they want a SINGLE Page all their clients can type in a unique password created by the photographer for each client, and then client is taken to their own page/gallery.
I’ve been searching for hours, and cannot find ONE plugin that allows this, instead I find people with huge convoluted, multiple plugin, code editing etc etc… and still does not solve my inquiry.
Any help/insight you can provide, would be greatly appreciated 🙂
Seasons Greeting Brian.
Cheers
Steve
Hi Brian,
great plugin! But is it possible that it does not work in WP 3.5? I cannot get it to work anymore…
Thanks!, Lex.
Hi Brian,
I really like your plugin! I was wondering if there is a way to force users to login every time (for added security if users are on public computers). For example, if i enter the URL for the page I have already looked at days ago, it goes directly to that page without prompting me for a password. I know that will work if cookies are turned off. I essentially have the opposite problem that Sharon described above. I need this security because my website deals with my rental clients and I want their personal information to have good security.
Thanks again for this great plugin and any help you an provide.
Hi Brian,
I like the idea of your plugin but I am having trouble getting it to work properly particularly setting a password. I am setting up a website for a club I belong to but I am very new at this. I am using InstantWordpress so that I can experiment more. Does your plugin work with InstantWordpress?
Hi,
How can I center the form? Should I do that in css file?
Regards 😉
Yes, you should be able to that from CSS. You may need to wrap it in a div to get it to center correctly.
Hey Brian,
Very nice and thanks for making my life easier.
One thing I do have a question on is the redirect with an invalid password. I noticed if the user submits the password with nothing in it, they are redirected to the latest or most recent unprotected post.
How do I get the error message to pop up with this kind of submission?
brilliant! just what i was looking for! thank you!
thank you for this excellent plugin!
Is it possible to put a placeholder on the password field – I know it sounds slightly pointless but the client wants **** by default!
Probably…
Read here: http://css-plus.com/2011/09/make-the-input-placeholder-user-friendly/
Hi
Will you keep updating the plugin for WP v ≥4.4?
As far as I can see, it works; but the information only says compatible up to 4.2.7
Yep, I will update soon. No changes are needed.
Do I put the .zip file in the plugins directory of my parent theme file or child theme file?
Neither. Just from your dashboard go to Plugins->Add New and in the upper right search box put in Smart Passworded hit enter and then click install on the plugin.
Got it. Thanks
This is a great plugin and very useful for some of what I need. However, I’m looking for a way for my customer to be able to enter one password that will allow them access to more than one page without others being able to access one of the pages. For example, the manager should be able to enter one password and access page 1 and page 2, but the sales reps will have a different password that will only allow them access to page 2. I understand that this plugin allows one password for multiple pages, but was wondering if you knew of another plugin that would allow me to do what I need, or another way to work around this.
WordPress that only allows 1 password per page and this plugin uses the built in Password feature. You could duplicate page 2 and turn it into page 3 with a different password OR require people to log in and set up permissions for the posts accordingly with some of the other plugins out there.
That’s what I was thinking I would have to do. Thanks.
I created two pages exactly the same. When I click on one page, I get the prompt for a password with the instructions to enter the password. However, on the second page, it gives me the header of the page and then the box to put the password, but the instructions are not there. I’ve recreated it several times with the same results. Please advise.
Hi,
I’m getting a password field on the child pages and my parent page is definitely not password protected, only the child pages are password protected. Do you have any idea why this is happening?
This would happen if you are visiting the child pages directly. You should visit the parent page, enter the password and be taken to a child page with no password prompt. I wouldn’t think it is possible for it to take you to a child page that doesn’t match the password because it uses a matching password to determine which page to go to.. If you are doing some custom things with cookies or switching between domains in the pages somehow, that could cause it, but that would be an exceptional thing to do.
Hi Brian, thanks for the fast reply.
I am going to the parent page, which in this case is www.(domain).com/customer, the password field appears, I enter the correct password and I’m taken to the child page which has a password field on it…obviously that’s the bit which isn’t correct.
I’ve tried restarting everything, now when I enter the password on the parent page I am taken to the site homepage, rather than the child page. I’m not doing any custom coding, but I wonder if there is a conflict with another plugin or the visual composer theme I have installed.
It would happen that way if the cookie the plugin writes out to allow you into the passworded page was blocked by the browser’s settings or by a plugin that perhaps does ‘security’ things.
So that’s what I’d check first. You can also use the Chrome “EditThisCookie” extension to see what is going on. Cookies sometimes get sooo messed up that they don’t function correctly until you delete them and start over even if you are doing everything right in your own php/plugin code. So, you could next delete the cookie for that site and see if it works correctly for you then.
This is a great little tool. Wondering about whether you might add configurable delay on retry to prevent malicious hammering on the password field to get to child pages. Or is there another way to prevent this? I realize that this tool is not supposed to be high security. Still, I do not like the idea of bad people fishing around if there is an easy way to prevent that. TIA.