• Hi. I’ve tried password protecting my posts page using WP’s built in password protect functionality (on Edit Page under the “publish” heading, under visibility. I’ve done this successfully on other blogs by doing nothin more than clicking edit, clicking “password protected,” filling in my password and updating.

    This time not so simple. So far I’ve tried the following:

    • Clearing cache
    • Different browsers and platforms
    • Deactivated all plugins
    • Updating to latest version of WordPress
    • Switching to default theme (twenty ten and andreas09, which is my parent theme).
    • Reset my permalinks to default, tested unsuccessfully, switched back to numeric
    • Made sure my WordPress URL and site URL matched in General settings
    • Checked .htaccess file to see if leftover code was causing the issue, but I didn’t see anything I would consider a red flag, though my understanding here is very limited. Here’s what’s in there:
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    
    # END WordPress

    These are all the ideas I’ve seen presented on the forums. Is there anything else I can try? Please see https://rtdsmartcard.com to see what I mean. Thanks all!

Viewing 15 replies - 1 through 15 (of 18 total)
  • Try resetting the plugins folder by FTP or PhpMyAdmin. Sometimes, an apparently inactive plugin can still cause problems.

    Thread Starter halfacre

    (@halfacre)

    Thanks for the suggestion, esmi. I really thought it would work, too, but unfortunately, no dice.

    It says the page is password protected on Pages, but I just can’t get the password prompt to show up anywhere.

    Ah! Is this a Page of Posts? If so, have a look at https://quirm.net/2010/09/08/protected-page-of-posts/

    Thread Starter halfacre

    (@halfacre)

    Ah ha! Yeah, I think we’re closing in. One thing: I’m still too much of a scrub to know for sure which file to edit if I’m using the default template for my page of posts. Is it archives.php?

    Yeah, I’m really showing my hiney now. Thanks esmi!

    Thread Starter halfacre

    (@halfacre)

    It’s page.php, isn’t it? ??

    Which page are these posts on? Are you using a static front page?

    Thread Starter halfacre

    (@halfacre)

    Yeah, static front, with an updates and Comments section that displays the posts.

    Thread Starter halfacre

    (@halfacre)

    So I made a custom template for this page of posts by duplicating page.php in the child theme directory, added the following to the top of the file:

    <?php
        /*
        Template Name: Page of Posts
    
        */
        ?>

    I added the code snippets from quirm.net (as best I could anyway, since my template and the one the author used for an example were nothing alike –?I had to fiddle with it to make sure there were no syntax errors), saved, uploaded it and changed the template on the pulldown menu on the Edit page for Updates & Comments.

    On the bright side, the page does not break. It simply displays the same way it did before, with no password prompt. This is, of course, in a browser where I am not signed in as admin.

    Thread Starter halfacre

    (@halfacre)

    *sigh* Still no luck. I tried working in those code snippets to page.php like so:

    [Code moderated as per the Forum Rules. Please use the pastebin]

    No syntax errors, but it still doesn’t work. Am I just way off base?

    A plugin is out of the question?

    Thread Starter halfacre

    (@halfacre)

    @christogeretz Not at all, but unfortunately I’ve been striking out there too. I’ve tried Members Only, Password Protect All Posts, Registered Users Only and none of them did what I really wanted, which was simply to have the Updates and Comments page not reveal it’s content to anyone without the password. Password Protect All Posts did just what it claimed, showing the title of each of the posts but hiding the content (not ideal for me). Registered Users Only and Members Only required a WordPress login, and for the life of me I couldn’t see how to create or assign a password, it just looked like someone had to create a wordpress account, which didn’t make sense to me, and I eventually abandoned it. If you know of one that does what I need, I’d sure appreciate a heads up on it. I just can’t understand why the built-in WP functionality doesn’t work.

    I use Members Only .. yes, you have to create a user and assign a password – worked for me but if you just want a password without a username it’s a little different!

    Thread Starter halfacre

    (@halfacre)

    I’m not too picky… I don’t mind setting up a username if I have to. The big thing with Members Only is that it protects the whole site, rather than just a specific page (in my case, the page of posts). Am I wrong about that?

    Sorry – I should have double-checked.

    Check out the plugins “Page Restrict” and “WordPress Access Control” – I use them both in conjunction.

    Thread Starter halfacre

    (@halfacre)

    @christogeretz – Thanks for the suggestions. I installed both the plugins, but I run into the same problem – I can not restrict access to the page. I mean, I can TELL it to do so, but it will not do it for the page of posts. It does work on the other non-post pages. This must still be due to a “page of posts” being considered an archive. I’m at a loss. The link esmi supplied seems to be the only one on the internet that addresses this issue, and I couldn’t get it to work. Heck, it even turns out that code on quirm.net is invalid syntax. Seemed so promising, too.

    As far as plugins that require users to be logged-in (like Members Only or WordPress Access Control), “logged-in” means they need to be logged in to WordPress, which seems really counter-intuitive in practice… visitor tries to access page, is sent to a WordPress login requesting a username and password. Visitors to this site will not likely have a WP account, and there is no link there to register for WP. What’s a user to do? Does anyone else agree that this seems kinda non-user-friendly? Am I missing the forest for the trees? I *am* pretty green.

Viewing 15 replies - 1 through 15 (of 18 total)
  • The topic ‘Cant get Password Protection to work on posts page’ is closed to new replies.