WordPress 3.4 Custom Password Form
Categories: WordPress Tips
Are your password protected posts and pages broken since upgrading to WordPress 3.4?
Here is a little tip for anyone out there who may be using a custom password form to protect individual pages and posts. WordPress has this functionality built into its core but it is possible to customize the wording and look of your form. If you aren’t able to get into password protected posts anymore, you likely have a custom password form.
This post isn’t a long description of how to make custom password forms, rather a helpful tip to fix your password protected posts and pages if they are no longer accessible since upgrading to WordPress 3.4.
The core of the problem is that WordPress 3.4 has deprecated the use of wp-pass.php which was used in many custom password forms and replaced it with wp-login.php. Below is what a custom password form function is likely to look like, at least it’s what mine looks like:
// Custom password protected message / form
add_filter( 'the_password_form', 'custom_password_form' );
function custom_password_form() { global $post; $label = 'pwbox-'.( empty( $post->ID ) ? rand() : $post->ID ); $o = '<form class="protected-post-form" action="' . get_option('siteurl') . '/wp-pass.php action=postpass" method="post">
' . __( "<h2>Enter Password</h2>
<p>This proposal is password protected. To view it please enter your password below:</p>" ) . '
<label for="' . $label . '">' . __( "Password:" ) . ' </label><input name="post_password" id="' . $label . '" type="password" size="20" /><input type="submit" class="submit" name="Submit" value="' . esc_attr__( "Submit" ) . '" /> </form>
';
return $o;
}
The first trick is finding where in your theme files that bit of code might be located. It could be in the functions.php file or in its own php file somewhere in your theme. Once you find it though, if you replace wp-pass.php with wp-login.php?action=postpass you should fix your problem. At least that’s how I updated my custom themes.

Pingback: Password Protect & Custom Password Form 404 « PixelPress Wiki
Pingback: Password Protection Trouble ~ ian-scott.net