[resolved] Comments box appearing on password page (3 posts)

  1. sonesh
    Posted 3 years ago #

    I'm new to wordpress, but have solved many of my problems by reading this forum, except one.

    I've password protected a lot of my pages, which is working fine, but I've just noticed pages which can be commented on, show the "Leave a Reply" form even if you've not entered the password.


    Pressing submit takes you to a blank page and doesn't post the comment, but works fine if you've entered the password, but I can see this being a problem if people are too lazy to enter the password.

    Any ideas?

  2. keesiemeijer
    Posted 3 years ago #

    Look for this in your theme's page.php:

    <?php comments_template(); ?>

    And change it to this so the comment form only displays on pages that are not password protected and on pages where the password has been provided [untested]:

    if(!post_password_required( $post )) {


  3. sonesh
    Posted 3 years ago #

    It actually seems to have fixed itself. Now that people have put comments in, the form has been replaced with:

    This post is password protected. Enter the password to view comments."

    Thanks anyway

Topic Closed

This topic has been closed to new replies.

About this Topic