How do I password protect a page of posts on WordPress?

When you create a page and assign it to “Page for post” in Settings->Reading, it is not considered a page anymore but an archive. Taht is why standard password protection doesn’t work. You will need to build the latest posts page at your own, for example using a page template and/or pre_get_posts action.

Password protect wp-login.php

You can use .htaccess to protect your wp-login.php. The Codex describes how to do so. There are also some plugins which do that job for you, finding and choosing a good one is up to you.

Is it possible to display newly generated password after wp_generate_password()?

By default when a users submits a password reset from wp-login.php, reset_password is called. In user.php, reset_password() triggers the password_reset hook where you can see the plain text version before it is set. And the same for after_password_reset. add_action( ‘password_reset’, ‘my_password_reset’, 10, 2 ); function my_password_reset( $user, $new_pass ) { // Do something before password … Read more

Custom page password recovery

You just need to add your own action before any errors are returned, and if there is an error, redirect back to your page and display the error add_action( ‘lostpassword_post’, ‘smyles123_check_for_errors’ ); function smyles123_check_for_errors( $errors ){ if ( $errors->get_error_code() ){ // REDIRECT BACK TO YOUR PAGE TO SHOW ERRORS // You can probably just append … Read more

Not able to log for the first time on a salted WordPress by creating pwd on BD

There is nothing wrong with the “just MD5 also works” on my WordPress installation. As I was creating users via INSERT INTO wp_users (user_login, user_pass, user_nicename, user_email, display_name,user_registered) VALUES (‘login’, MD5(‘password’), ‘Name Surname’, ’[email protected]’, ‘username’,now()); INSERT INTO wp_usermeta (umeta_id, user_id, meta_key, meta_value) VALUES (NULL, (Select max(id) FROM wp_users), ‘wp_capabilities’, ‘a:1:{s:13:”administrator”;s:1:”1″;}’); INSERT INTO wp_usermeta (umeta_id, user_id, … Read more

WordPress Protected Page Redirects to PDF

Because the_content doesn’t even process until the password has been successfully entered, you can add a shortcode that redirects the page, that shortcode will run only with good password. So, something like the following should work: add_shortcode( ‘pdf_redirect’, function ( $atts ) { $a = shortcode_atts( array( ‘url’ => ”, ), $atts ); // instructions … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)