Esmi’s solution does seem to have a syntax error (mismatched quotes?), but when I made those corrections it still didn’t work.
It appears that a recent change to WordPress broke that solution — at least according to the Codex article on Using Password Protection and my tests on WP 3.5-alpha-21466 (sorry, but I haven’t reset my test environment to 3.4.1).
A different solution from the forums, does seem to work:
function custom_password_form($form) {
$subs = array(
'#<p>This post is password protected. To view it please enter your password below:</p>#' => '<p>This is the new message.</p>'
);
echo preg_replace(array_keys($subs), array_values($subs), $form);
}
add_filter('the_password_form', 'custom_password_form');
Ref: https://www.ads-software.com/support/topic/password-protect-this-post-change-text?replies=6 While it’s for WP 2.6 from four years ago and so may not be using the most recent features, it seems simple enough and the post shows examples of how to add CSS to the form elements.