Smart Passworded Pages Plugin

Here is a demonstration of how to use the smart passworded pages.

If you are unfamiliar with using passwords in WordPress, you might want to read this page first:

This plugin doesn’t add the ability to add passwords in posts.  WordPress does that all on its own.  You can see that here:

An image of the publish widget from the WordPress page editor.
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.


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:

You can find out more about the current version of the Smart Passworded Pages plugin here:


Now let’s get down to it.  First, watch this video about how to use the plugin:

(Press play and then click the full screen button on the bottom right for the best view.)

Now you can test how this plugin works.  Pay attention to the fact that you can enter multiple passwords on a single page and then end up in different locations within your website.  Test how it works on these pages:


115 thoughts on “Smart Passworded Pages Plugin”

  1. Hi.

    Love the idea of the plugin. I have it setup but when I enter a password which corresponds to a particular protected page I just get a message saying “You’ve entered an invalid password.”
    I have 2 seperate pages protected with individual passwords. Not sure what I am doing wrong.

    Any ideas?

  2. Never mind. I worked it out. Just realised they had to be child pages! (duh)
    Works great now! Thanks

  3. it’s really not explained anywhere HOW you setup a password for a page. or am i missing something obvious?

  4. Hi Brian… i love your plugin and was so happy to have found it! I had it working and then when I upgraded to WordPress 3.4 it doesn’t work as it did in the past. I have a parent page “clients” and when I type in the password for a corresponding child page, it brings up the child page but says “this post is protected, please enter password.” before, I would just type the password in on the client page and it brought me right in, I never had to type the password twice. I uninstalled and reinstalled the plugin, thinking that might work… and even checked your demo page and it does the same thing on your website. My coding skills aren’t solid enough to get in there and play with the php files, but was wondering if you knew why this might be happening? I assume it has something to do with the WordPress update… Thanks again!

  5. Thanks For the heads up on this Jaclyn. I’ve updated the plugin and you should be able to download the latest and greatest now and it works fine with 3.4 and all earlier releases.

  6. I think I am using the latest version 1.1.0 and WP 3.4 and I am getting the same problem as Jaclyn.

    If I haven’t got the latest version, could you point me in the right direction please.


  7. Terry,

    Thank you! The version I submitted as 1.1.0 didn’t have the final changes in it and it simply didn’t work. I’ve created version 1.1.1 and you should be seeing an notice to upgrade in your dashboard shortly.

  8. The website is a beta, so the URL will change. I’m trying to figure a way to remove the “PROTECTED:” text that gets added to pages controlled by the plugin. I don’t see it in a scan through the plugin pages. Is there somewhere else I should be looking?

    BTW, great plugin. Love that I don’t have to create “fake” users just to keep certain pages/sites for certain groups.

  9. I must be really dim cos I can’t get this plugin to work.
    I made a main page, then a child page, set them to be password protected by wordpress with the same password.
    Put in your shortcode.
    I just get the old wordpress login box, which doesn’t work and is the reason I wanted to install a plugin that did. Please help!!!

  10. Brian, this is a very nice plugin! Very sweet application that can solve a lot of issues, for sure!

    However, all of your documentation, written and video, COMPLETELY MISSES THE MOST IMPORTANT POINTS!

    No wonder you have confused people!

    Brian, life in WordPress does not start with your plugin. Your plugin happens along AFTER other things have been done first that are OUTSIDE of your Plugin. There is an important Pre-Requisite.

    You are telling your story backwards and people have been wondering “what am I missing?”

    They expect you to Walk them Through it, Everything needed first to Use your plugin — Step One, Step Two..but from the beginning that starts outside of and before using your plugin…

    Maybe they found your plugin and assumed from the way you talk that you took care of the PASSWORD application completely. But your plugin does not do that. It is not the whole answer, it is a helper, and extension, not a Stand-Alone Plugin.

    You have forgotten to Orient Users to tell them, first of all, that your Plugin is an EXTENSION, so to speak of an existing WordPress function — WordPress “password protect”.

    And that what your plugin RELIES on, or it does not work at all, is the procedure WordPress is installed with to “password protect pages”.

    And that what your plugin then “extends” is the ability to place that Password Submit window and button on a page that can contain text and images, that can be seen at the same time on the same page as the Password Field and Submit Button.

    That your plugin allows Users to take the “WordPress Password utility” and instead of blocking the entire page content with a “No Farther until you Submit the Correct Password”, your Smart Password Plugin allows us to post a Title, Instructions, images, whatever and then to see the rest of the content (continued on a Child Page) after the Password field is filled out with a Submit button.

    It would have been quicker to get people acquainted with Passwording in WordPress because it is absolutely essential to do this, to know how to do this before your plugin can work or even make sense.

    If you would have said, “OKAY, First, if you have never used the WordPress Password Protect Gizmo, let’s got take a look at that when we make a New page or Edit an Existing page.

    To use my Smart Password Pages Plugin you will FIRST have to MAKE a password for the intended page.

    in the PUBLISH settings on the Right of your new or existing page let’s Click and Open up “Visibility” by Clicking the “Edit” link. Here you will select the “Password Protected” radio button and then fill in the white field that opens up under the text “Password:”.

    Enter the password of your choice, click OK, and then the blue UPDATE button to save everything.

    NOW we will use the same procedure to make your Child Page that will hold the information you really want to protect.

    So, we will have the Parent page protected by the same Password.
    Your child page you will protect using the same Password.

    NOW you can use my Smart Password Page shortcode in the PARENT page — this will be the First page a User sees and this is where the Password field will appear and the Submit button, exactly where you place the code [smartpwpages] in that page content area. Save the page once you have the Parent page ready.”

    Something along those hasty lines ….

  11. Wow! I am going through your site reading all the tidbits! Looking at the spiffy code for finding the Parent Category of all children, for one thing.

    Cruising through the PHP, WordPress, Scripts …. NICE! Lots of usable articles, well described!

    I just bookmarked you on my “short list”.

    Thanks. I am feeling moved to “Donate”.

  12. Hi Brian,
    I was so very excited to find your plug-in because it suits my needs exactly.
    After many hours of trying and trying, I still can’t get it to work correctly.
    I have a main parent page (Portfolio), password protected, with your short code installed.
    Each child page is password protected with the same password and numbered accordingly.
    Problem 1- when entering the password in the parent page, instead of going to child-1, it gives a “page not found”.
    Problem 2- each child page disappears when I try to view it.

    I am using a theme by Elegant Themes ( FLEXIBLE )
    Any suggestions or should I just jump off the ledge? : O


  13. I’ll take a look and see if anything has changed in 3.4.1 that would affect this and if it has changed, I’ll put out an update. There were Password changes in 3.4 but the coding handles it. There may have been a tweak to this new code.
    @DavidH Thank you for your advice! and also I think you can find that same video here
    @all Please bear with me this week as I am fighting a double ear infection atm and that makes thinking straight kinda hard!

  14. Brian, sorry to hear about the double ear infection! I know what that is like and it is hard to think or conduct normal business.

    I have checked the video link you have posted and I still get a full black page that is all player .swf but without the reference video file loaded.

  15. I have been using WP 3.4.1 and it works fine. However, regarding problems with Elegant Theme Flexible it is probably because it substitutes its own functions for native WordPress.

    Note this:

    There is an exchange in this page that talks about Elegant Themes overwriting a posts_per_page parameter globally. The responder even posted a Fix for the way that Elegant Themes function was written.

    I think your problem relates to this already noted issue.

    Sometimes also this can be overcome by going into your WordPress panel and into SETTINGS -> Permalinks

    Checkout the “Custom Structure” if that is what you have selected and THEN SAVING.

    Sometimes this will effect a change, and if you have a CACHE program in place, delete the cache files before trying again.

    But if that is not solving things with Smart Password Pages then the issue is the functions that your Flexible Theme is overwriting with its own queries.

    Perhaps Brian can use this information to help you.

  16. Oh yuck! That’s Horrible! That could very well be the issue. I’ll build in a fix for this later this week and we can see if it works. I would not have thought of anyone doing this. Thanks David!

    Brenda: This will come to you via the normal update system.

  17. David, I did go into the settings to make sure “custom settings” was unchecked and it was. Also deleted the cache.
    Brian, looking forward to the update. thank you. In the mean time, any other help would be appreciated. I’m in over my head on this one.

  18. Hi Brenda,

    Well, if you were not running Flexible with custom code then okay. But many custom themes ask you or require you to run a custom code in the Permalinks.

    At any rate, SAVING what you have in there refreshes the Permalinks which can be necessary sometimes with changes in a Plugin or Theme.

  19. Brian: Is there anyway to modify the “Protected:” heading to something else? Where is this title generated at?

    Thanks for making such a useful plug-in!!!

  20. Hi there! I am trying to use your password on a friends site that I have created for her. I used CAPA previously but occasionally, it does not allow a page for absolutely no reason. so this happened again today and I decided to find another plugin which led me to yours.. I am having problems with yours. i am hoping you can help me out or I am back at the drawing board. I put your code [smartpwpages] on one page, talent.. it has a tab at the top. i went into the page, found where i hit publish, put private, put in a password. it worked once then it didnt work again. now the page acts like its completely unprotected, i can click on the tab and i am looking at the page. i like your idea, i have 6 pages linked off this page and many many more from them.. .i am changing this site alot so I thought just doing that one page would be sooo awesome!! but i can seem to get the one page with a password working.. suggestions? thanks kristina, homeschool mom, 4 boys.

  21. hi bryan, please delete my message.. i figured out what the problem was on capa and made it again work for the site.. i still had the problem i stated.. just incase you have the prob with someone else.. have a great weekend.. k

  22. Hi Bryan,

    I just found your plugin and I *love* it! I’m so happy to have found it. But I do have one question… when I use it on my brother-in-law’s photography site, using WP 3.4.2 and the Photocrati Theme, after I log in to my password protected pages, the first thing I see is the phrase “Protected:… ” with the name of the page that’s protected. That’s fine. No issue there. But then the next thing I see on the page is a blank text-box with a submit button next to it that says “Enter.” Immediately following that text box is the password-protected content. I’m concerned that people will see the text box and the “Enter” button and think that they need to enter their password again. Is there any way to get rid of this additional text box with the “Enter” button?

  23. Hi Bryan, I failed to provide you with the link to my brother-in-law’s website:

    It’s not launched yet so it’s still in a directory called “site.” I haven’t moved the index page to the root directory. Plus, all the photos on the site are mine until I add my brother-in-law’s photos. :) Thanks for you help.

  24. Hello again Bryan, I wanted to see if the text box with the “Enter” button was only happening with the Photocrati theme so I tested the plugin on another site that uses the Headway theme. It’s still doing it. But I noticed that your demo pages DO NOT have the text box with the “Enter” button. I’m hoping it’s something that can be fixed so that I can use it on websites with either Photocrati or Headway themes. Thanks again for your time.

  25. This is a great plugin. It is simply smart. I couldn’t use it with HTTPS, but it may be because of my limited skills.

  26. Thank you so much!!! It took me hours for going through tons of different plugins to try and find what I wanted and I found it!!! THANK YOU!

  27. I have this set up on my site, works great on all browsers except IE9, when you use the correct password it says that you didn’t. Any ideas? Anyone else have this problem? (I can’t post the site, my client won’t let me)

  28. I see that the Demo pages don’t work in IE9 either, has anyone found a fix for this? I’m really hoping not to have to find and implement a different password solution.

  29. I think I may be doing something wrong but I followed your very limited instructions. I put [smartpwpages] and I created a password within WordPress. Why do I need your password program if I can create a password protected page with word press?? After putting [smartpwpages] on the page I want password protected it doesn’t work properly anyhow. When I enter the password instead of it taking me to the password protected page it takes me to the WP_admin login screen???

  30. Hi Brian,
    thank you for this plugin. Unfortunately I have the same problems like Jaclyn wrote on June the 15th 2012. I am using version 1.1.2 with WordPress 3.5.1

    Kind regards from Cologne

  31. Hello Brian,
    Awesome plugin, have been searching for this as a needle in a haysteck! And finally found your solution.
    I have one question. Is it possible to have a username and password instead of only a password?

  32. Hey, Brian. The think the plugin itself is awesome. Allthough i’m having the same problem as others here in the comment field. I first get the default password protected page -> then the custom one -> then i enter det child page. I have wordpress 3.6 and Brespon Zeme as theme.

    Do you have a fix for the problem? Thanks in advance!

    – Joakim

  33. Hello:

    I am building a WP site for a police union. i am trying to have a public section up front and a members only section that is password protected. The tricky part is that all the members need to have there own password. I am using the Participants Database plugin to manage member info. is there a way for me to accomplish this.

  34. John, There are three main plugins that people use to get behavior you want.
    I stick to the first one and use Gravity Forms or another plugin to sell the membership via paypal. The other have a different look and feel and do similar things.
    That last one, Membership, has the most features and the free lite version may fit your needs. The full version is also only $19 which makes it pay for itself pretty quickly.

  35. Hi, I just downloaded and activated the plugin but I can find anywhere to set it up. There is nothing in settings or on the plugin page. Where should I look? I am looking for Smart Password pages.

  36. The plugin was working just fine yesterday. Today its not working. I did update to the newest WordPress today but that is the only change I made. Could that be the reason? Is there a fix?

  37. @Ronda and all,

    I found that version 1.1.3 was never made publicly available. That version is required for version 3.6 and newer of WordPress. I’ve updated the plugin to 1.1.4 and it is should solve your problem.

    I also added some documentation that explains, to everyone who hadn’t already figured it out, how to password protect WordPress pages.

  38. Hi Brian,

    This plugin is great, just what I need, so thank you.

    However, there seems to be a bug; all works fine if you enter a password that exists, but if you miss type or enter a non existent password I get:

    Fatal error: Call to undefined function __e() in /var/sites/c/ on line 50

    Any ideas?

  39. Hi Dean!
    It looks like you found a typo in the latest version. That should either be __() or _e(). Probably the latter. I will fix that and update.

  40. Hi Brian,

    We had the same error mentioned by Dean above happen to our site today.

    I changed it to _e instead of __e <- notice the extra underscore everyone? :)

    That resolved and fixed everything.

    Thanks Brian!


  41. John Hardy on May 7, 2013 at 5:31 pm asked this question for which I didn’t find a response:

    When I enter the password instead of it taking me to the password protected page it takes me to the WP_admin login screen???

    This redirect is now happening to me, too. I also fixed the underscore typo- but the redirect was happening before and after I did the fix.

  42. Hi Brian. No, it still doesn’t work. I tried in both Firefox as well as Chrome.

    When testing in Chrome, I was reminded (by a little pop-up) that since I have Kaspersky 2014 secure keyboard input running, This app runs quietly in the background- and I’ve never had issues with it before- and, most of the time, you never know it’s even there. I never get the popup in Firefox- my mainto.

    Would you like me to send the credentials to you (directly) so you can see for yourself?

  43. Thanks for the quick response! I appreciate and respect that work ethic.

    Short answer: yes, your URL works.

    But mine still doesn’t.

    I’ve narrowed it down to a plugin:
    SP Client Project & Document Manager 2.1.0

    • I’ve tried disabling all the plugins from the server level (just added an underscore to the file folder name) just as a test, but they are all non-impacting. They are:
    • All in One Favicon
    • Customize Login image
    • exclude-pages
    • page-links-to
    • slider-pro
    • wp-google-analystics

    So it’s that “SP Client Project & Document Manager” plugin.

    It’s not the end of the world if we can’t get it to work. However, I will be happy to give you the credentials if you want to login and see for yourself.

  44. Hey Brian,

    I’m trying to get your awesome plugin to work in the footer of my site. I’ve made all the pages children of the Home page, but it still doesn’t work. Is there anyway to make this happen?


  45. Actually I figured out a solution that will work for me. So, if you don’t mind, can I ask you if there are any CSS things I can change such as the size of the box, changing ‘Enter’ to something else, etc.?


  46. Great plugin, thanks for your work on this.

    I’m wondering if there’s a way to change the password character limit from 20 to 24?

  47. Sure! You can format that area by putting these sections in the CSS:
    form#smartPWLogin {}

    If you want to change the label in the button, just put label=”Something Else” in the shortcode.
    Like this:
    [smartpwpages label="Something Else"]

  48. Brian – I’m in the process of testing a site and am playing with various passwords. Is there a way to clear the cache without going to every single page?

    As an example, when I change the parent page password, I would expect that all the child pages would no longer be accessible. Since this isn’t the default behavior, how can I force the child pages to ask for a login when the parent page password has been changed?

    Thanks — Mark

  49. I have the same question at Sietse, can a username and password be required? If so, can you explain in detail how to do that?

    Thanks – love the plugin

  50. Hey Brian!

    Thanks for the great plugin – works perfect for what I need it for, however, now when I try and change my sidebar it does not change, and on the protected pages the admin bar across the top of WP shows as a white box (this is not a problem) BUT I do need to be able to customize my sidebar and the plugin seems to be not allowing that to happen – any thoughts on this?


  51. Hi Brian – great work on this plugin. Exactly what I needed and I found it quickly.

    I’m having a CSS issue – probably unrelated to your plugin but I’m hoping you can help me out.

    The “enter” button appear below the password field on my site and I’d prefer it be to the right of it. I’ve played around with the CSS but I’m either not doing it right or not putting it in the right place. Can you help me out?

    Thanks so much.

  52. Can I have the plugin setup to have all my child pages password protected by using only one password on parent page on the site; meanwhile keeping all my other pages public.

  53. Hi,

    Your plugin fits my needs almost 100%. It would fit my needs perfectly if it could make the entered password not be case-sensitive.

    Anyways… I had your plugin set up on my website and set out to solve my “case sensitive passwords” problem. I tried many plugins with no luck. Upon giving up for the day, I set my site back to its original state. (with Smart Password Pages working) Your plugin will not work on my site now. I’ve deleted all of the plugins I tried today. I’ve tried using the default theme. Your plugin is installed and activated, but it’s like the page that I have the shortcode on is not being recognized by the plugin. Any ideas on what I can try?

  54. Hello Brian and Happy New Year,

    Please help! You are the only one that can save me!

    I’m a photographer and building a new website using WordPress. I want the ability to provide protected pages/galleries so clients can easily access their photos based on a password that I provide them. After searching the internet, it seems as your plugin is the only simple solution. I’ve have incorporated the plugin into my new site and love it!

    I also plan to use WooCommerce so clients can purchase photos. The problem is once you add a photo to the cart and leave the password protected page, there is no easy way to get the client back to the protected page within the WooCommerce product page or cart page. Sure, a user can just hit back on their browser but that isn’t clean. WooCommerce does provide a “Return to Shop” or “Continue Shopping” button but that links back to their Shop page. That is a big problem because the Shop page shows all products including other client’s photos. Not good.

    What I really need is a way to get back to the last visited protected page while in the product page or cart page. As of now, I can edit the WooCommerce code and change the “Return to Shop” or “Continue Shopping” URLs to return to your login form. At this point, the user will need to re-enter their password again to see their page/gallery. While doable, this is cumbersome for users.

    This is where I believe you can come to the rescue and make the sun shine again.

    Is there a way for Smart Passworded Pages to automatically redirect users to the page they recently logged into? Meaning, I could change the “Return to Shop” and “Continue Shopping” buttons to redirect clients back to the login page which would then redirect them to their page based on their already supplied password? I would think in most cases that there would be only one page per client. At least in my case that would be true.

    I’m really desperate need to find a solution to this. I’m a small time photographer but willing to pay for your services. Please let me know if you can help me (and the community).

    Susan Scheff

  55. I have the parent page set up with the shortcode to input the password for that page. It takes me to the child page just fine, but I also have to input the password on that page to view the content, and I don’t have the shortcode on that page. Do you know what I could be doing wrong? Thanks.

    Awesome plugin, BTW. :)

  56. Hi Brian,

    This plug in was just what I needed. However I’m having a problem mentioned by a few folks above. Using version 1.1.5 on WP version 4.1 it makes me put in 2 passwords.

    The first password is the standard WP password, once I get past that I am faced w/ a second password field and Enter btn. Once I go thru that I arrive at my content.

    Is there a way to not have the 2nd pwd field and just go into the content after the first?

    Thank you!

  57. Great plugin! We’ve been using it without a problem for a few months.

    However, recently it has begun throwing warnings whenever we try to log-in through it (and does not let us into the protected the page):

    Notice: Undefined variable: post in [removed]/wp-content/plugins/smart-passworded-pages/smartpwpages.php on line 133

    It seems to be related to the reference to the post object in the process_form() function.

    You can see it in action here:
    Just try logging-in with any password (the error is thrown before the password is processed)

    We’d appreciate any help you could provide.

  58. Thanks!
    ALL: I’ve already fixed all of the hints and version issues people are currently having. I’ll try to that code checked in this week. Maybe today between tasks if I can.

  59. Everything seemed to be working fine with the plugin until I started getting a bunch of spam on posts that could only be seen on the protected pages. I tried putting all posts and pages into draft mode, etc. While troubleshooting I noticed that if I googled words contained in the protected pages they were accessible directly from google. I have now edited out the more sensitive information, but would still like to keep the password feature.

    When I republish the pages, the parent page asks for the password, but when it is entered I get a 404 error. I’ve tried re-entering and republishing all the pages, but this doesn’t have an effect.

    Any ideas on how to fix this? What about the backdoor google problem?



  60. Even if a page is not linked to specifically from a menu or other post, there are MANY ways it can be discovered by Google or spam bots.
    If you don’t want a post to be public, it needs to be passworded or private. You’ll have to put a password on all of those posts. That’s part of why this plugin exists.

  61. Just dropping by again to say thanks. The recent update fixed the problem I reported above with stray php warnings.

    A very useful plugin, and great support!

  62. Hi,
    the button to send the password says “Enter”. How do I change that word?

    Thanks in advance.

    Very useful plugin indeed … :-)

  63. Hi Brian,
    The password field / button remain on the page after login.
    I have the same problem with the plugin, but did not find your answer/solution:

    FEBRUARY 6, 2013 AT 7:20 PM
    Love your plug-in, but I have the same problem as Peggi (Nov. 5, 2012). Any solutions?

  64. Hi Brian,
    I like this plugin but I have a question. I’m using my website as a teacher and would like to have one password for each course parent page and the unit child pages all unlocked by that same password. Your plug-in does that well but it always takes the viewer to the first child page. Is there anyway it could unlock the pages but keep them on the parent page so they could select the now unlocked child page that they would like?

  65. I have protected one page with a password and want to make a login form in sidebar of all pages (as a widget). So people can login in sidebar and get acces to protected webpage immediately. Is this possible with your plugin?

  66. Hey great work there Brian! I have been looking for this function for hours now! Works great and exactly what I needed.
    I just have one small problem/question.

    I am working with a theme on my WP Site and the plugin does not seem to work with the theme. I had to redesign the site but it doesn’t really look like the way I wanted it to.
    Is there anything I can do to use the themes style with this?

    Thanks again.

  67. Hi Brian,

    Great plugin!
    Thanks for developing.

    Nevertheless I wanted to let you know I was having some issues with the error message in the password form, being displayed before any password was even entered.

    It was shown at all times.

    I’m not a master in PHP but I think I’ve found a typo or a fix in the else and if statement.
    See below, and maybe you might want to add something like this on the next update. Then one would be able to edit the class of the input field to style it via css, if there’s an error as well as adding some error text.

    Instead of this:

    function smartpwpages_shortcode( $atts ) {
    global $post;
    extract( shortcode_atts( array(
    'label' => __( 'Enter', 'smartpwpages' ),
    'ID' => 'smartPWLogin',
    ), $atts ) );
    $result = '' . PHP_EOL;
    if ( isset( $_GET['wrongpw'] ) ) $result .= '' . __( 'You\'ve entered an invalid password.', 'smartpwpages' ) . PHP_EOL;
    $result .= ' ' . PHP_EOL;
    $result .= ' ID . '" />' . PHP_EOL;
    $result .= ' ' . PHP_EOL;
    $result .= ' ' . PHP_EOL;
    $result .= '' . PHP_EOL;
    return $result;

    I changed it to this to add error text and error class on input field:

    function smartpwpages_shortcode( $atts ) {
    global $post;
    extract( shortcode_atts( array(
    'label' => __( 'Enter', 'smartpwpages' ),
    'ID' => 'smartPWLogin',
    ), $atts ) );
    $result = '' . PHP_EOL;
    if ( isset($_GET['wrongpw']) ) {
    $result .= '' . __( 'You\'ve entered an invalid password.', 'smartpwpages' ) . PHP_EOL;
    $result .= ' ' . PHP_EOL;
    } else {
    $result .= ' ' . PHP_EOL;
    $result .= ' ID . '" />' . PHP_EOL;
    $result .= ' ' . PHP_EOL;
    $result .= ' ' . PHP_EOL;
    $result .= '' . PHP_EOL;
    return $result;

    Well, hope this helps anybody that was looking to fix that error and style the form even further.

    Happy coding!

  68. Hi Ilithya,
    I’ve looked at the code you changed and couldn’t reproduce the error you are reporting.

    That error is only included when the parameter ?wrongpw is in the URL.
    You can see the difference by clicking on these two links:

    Perhaps you have that parameter cached or in the link you are using? The code change you made doesn’t do anything other than adding an extra space whether the password is wrong or not.
    If I had to wager money on what is happening, I would say that you are using a caching plugin that had cached your the page generated with the wrongpw parameter and it was incorrectly always serving that source code. The source code change you’ve included here only worked because the cache timed out or was invalidated while you were working on things. For a permanent fix, try excluding this page from the cache if you have that option or simply turning off the caching program so that you can test.

  69. Yes! If you look at the code on the page every element has an ID that can be accessed from CSS.

    Style away!

    Here is what you are working with:

    <form id="smartPWLogin" method="post" action="">
    <p id="smartPWError">You've entered an invalid password.</p>
    <input class="requiredField" type="password" name="smartPassword" id="smartPassword" value="" autocomplete="off">
    <input type="hidden" name="smartParent" value="1">
    <input type="hidden" name="smartPWPage_nonce" value="123abc">
    <input type="submit" value="Enter">

  70. At this point, this will only work if you put the widget on the parent page for the post. However the next release will support this feature.

  71. Not at this time, but the easy fix for this would be to make the very first locked page an index page for all of the other child pages.

  72. Are you passwording the page with the shortcode? only password protect the child pages and that should resolve the issue.

  73. Yes. Kinda. You password the child pages and the clients enter the password on the parent page. All unrelated pages can be kept public

  74. Hi Brian,

    Thanks for the fast reply.

    Well I don’t know how I got this error, for 2 days.
    I only had a Contact Form plugin installed, apart from yours.
    And I don’t know if it had to be with the fact that I was developing locally on my server.

    But today I’ve retested again by deactivating this other plugin and you’re right, there’s no error. I apologize. I have no idea how I got that error before.
    Now I don’t see it either.

    Anyways, my 2 cents on the code I placed before was mostly because I wanted to suggest not to only add an error text if one enters the wrong code, but also add a class to that input field, so that one could style the input field. Because for example, maybe I don’t want any text to be shown after an error, but instead styling the input field with a red border or something. And so my suggestion was basically this:

    Input field:
    input class=“requiredField”

    Input field, after error:
    input class=“requiredField errorField”

    And since I’m not a master in PHP, I figured the best to do this was with this:

    if ( isset($_GET[‘wrongpw’]) ) {
    $result .= ‘ input class=“requiredField errorField” type=”password” name=”smartPassword” id=”smartPassword” value=”” ‘ . PHP_EOL;
    } else {
    $result .= ‘ input class=”requiredField” type=”password” name=”smartPassword” id=”smartPassword” value=”” ‘ . PHP_EOL;

    Apart from that, I must say that when I entered a wrong password, I don’t get that url “?wrongpw” you mentioned. Even when I try your demo here in your site, and type a wrong password, I don’t see that wrong url on my navigation bar.
    Of course I see it from the link you posted. But if I got to your demo and try to test the error by typing a wrong password, the navigation url stays the same, and only the error message is being displayed.

    I wonder if it could be possible to display that “?wrongpw” url after typing an error message if one would like to show it.

    Anyways, thanks again for developing and taking the time to read the comments here :)

  75. I have my portfolio page password protected, but the portfolio items still show up. Then I realized maybe the individual portfolio items needed to be protected as well, and I tried adding a password to an individual item, but it still showed up on the password protected page. Is this a known limitation, or am I doing something wrong?

  76. Hi Brian,

    I’m a bit of a CSS newbie and having trouble figuring out how to target and style the button. The IDs you provided work for the background of the entire login section and the input field just fine but I’m not seeing how to affect the button (other than its label). What am I missing?

    Thank you!

  77. Love the plugin and it works great but it would be nice if the user had the ability to reset the password to one of their choosing (with an email to them with their new password). Adding an email field would be helpful, too. This might be a little much to ask for, though.

  78. Unfortunately this plugin is simply an add on top of the existing WordPress page password features. However, there are lots of plugins that control access to pages according to the user rights. You might want to look at some of those membership plugins to find one that fits your needs better.

  79. Brian, update here. I figured out how to do it and got it working exactly how i wanted. So its all good now. I let go of that arrogant plugin a did a simple integration of google’s recaptcha. It worked.

  80. Hi Brian,

    I love your plugin. Can you add one simple feature to this plugin? Whenever someone enters a password, just email that password and child page name to admin? Thats it.

    I would like to use that feature as an alert that lets me know when a new sales prospect has logged in to their page. I hand out business cards with their password to a custom sales page made just for them. The email alert would let me know who is really interested in my services. I would not have to followup a million times. Just those who are interested :)

    I would pay/donate. Let me know.


  81. Hi John,
    Add this as line 144, right before the wp_redirect. Make sure you replace the email address in this line with your own:
    wp_mail( ‘’, ‘Successful SPP login’, ‘The password used was: ‘ . esc_attr( $postPassword ) );

  82. Hi Brian,

    I added it but got an error:

    Parse error: syntax error, unexpected ‘@’ in /home/content/p3pnexwpnas04_data03/46/2416846/html/wp-content/plugins/smart-passworded-pages/smartpwpages.php on line 144


  83. My fault, I fixed it, it was a formatting error when I copy and pasted your code:

    wp_mail( ‘’, ‘Successful SPP login’, ‘The password used was: ‘ . esc_attr( $postPassword ) );


    wp_mail( ‘’, ‘Successful SPP login’, ‘The password used was: ‘ . esc_attr( $postPassword ) );

    I changed the apostrophes

    Thanks for helping me!


Leave a Reply

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