23
votes
How to change user password with wp-cli?
first check the user name:
wp user list
then change password without leaving traces in history
wp user update admin --prompt=user_pass
16
votes
Accepted
Why does hashing a password result in different hashes, each time?
By default, each time a new hash is generated (e.g. wp_hash_password()) WordPress salts it with random bytes, producing a unique hash for each call. The string returned from wp_hash_password() ...
14
votes
Accepted
How do I create a password reset link?
After much research, I finally turned to examining the WordPress core file wp_login.php hoping that WP would show how they do it in a non-obtuse manner. From the information around line 331 (WP 4.6.1)...
12
votes
Sending the reset password link programatically
None of the above answer worked for me so I looked into wp-login.php for their default reset functionality. They used get_password_reset_key( $userData ) function . In case someone stuck up on above ...
10
votes
Accepted
Missing URL in password reset email
The problem is the < and > which surround the reset URL in wp-login.php. You can remove them using retrieve_password_message in your theme functions.php file like below:
add_filter("...
10
votes
Accepted
Best way to send users password?
You shouldn't have to send them passwords. That's a bad idea.
Instead, make sure your web server has email setup properly and your user accounts have the correct email addresses. Then all you'll have ...
10
votes
How can I modify the default reset (lost) password email text?
To answer your specific question, "How can I modify the default reset (lost) password email text," the answer would be to use the retrieve_password_message filter. And ultimately that might be a way ...
9
votes
How to apply the "retrieve_password_message" filter?
the given answers have good intentions. But are not good. There are more parameters to the filter function call, 4 to be exact.
this worked for me for the message (i wanted to replace username with ...
9
votes
Accepted
If I change the salt keys in my wp-config will all passwords break?
No the passwords won't break (those are in the database and aren't changed by changing the salt). However all logged-in users will have to login again.
More on Salts here.
Note: Updating your ...
7
votes
How do I require authorization / login to view a specific set of posts / pages?
This is just a modification of timshutes' answer - if you want specific pages to require login and don't want to put them into a custom post type, you can add to functions.php:
add_shortcode('...
7
votes
Accepted
Change default recovery link expiration time
I would think this would change it to a month:
add_filter( 'password_reset_expiration', function( $expiration ) {
return MONTH_IN_SECONDS;
});
using the built-in MONTH_IN_SECONDS constant.
For ...
6
votes
How can I change the email sender name from wordpress to (myblogname) on the "lost password" email?
If you have a custom login page already, you may not want to introduce a whole new plugin. You can change 'from' name and email with these simple functions in your theme or plugin.
To change the name
...
6
votes
Accepted
Password protect custom template
Okay so I made it work with include this is my updated code:
<?php /* Template Name: pw-protect */ ?>
<?php
global $post;
get_header();
if ( ! post_password_required( $post ) ) ...
6
votes
Accepted
Change Password Hint
Just add a filter, where you can change the text, like this:
add_filter( 'password_hint', function( $hint )
{
return __( 'MY OWN PASSWORD HINT' );
} );
This can be added in functions.php in your ...
5
votes
Add error message on password protected page
Following up from fuxia's answer. The complete snippet, including the check if the page load came from the same page, would be:
add_filter( 'the_password_form', 'wpse_71284_custom_post_password_msg' );...
5
votes
Create a USERNAME and PASSWORD protected WordPress page
What about considering a specific template that tests to see if the user is logged in using something like:
if ( is_user_logged_in() ) {
// your code for logged in user
}
else {
// your code ...
5
votes
Send password to user instead of reset password link
You can use retrieve_password_message hook for that.
That filter is applied as this:
apply_filters( 'retrieve_password_message', string $message, string $key, string $user_login, WP_User $user_data )...
5
votes
Accepted
How to disable Woocommerce password recovery and use the default WordPress password reset page?
I found the solution in WP forum. Here it is:
To remove the WooCommerce redirect for the “Lost Password” link, you’ll want to remove the “Lost Password” endpoint setting as found under **WooCommerce &...
5
votes
Accepted
Password protected page with a form submits for me fine but for others redirects them back to the password prompt
When a user logs into a protected page, WordPress sets a cookie. We can check for the existence of that cookie with this conditional:
if ( isset( $_COOKIE['wp-postpass_' . COOKIEHASH] ) ) {
// Do ...
4
votes
Sending the reset password link programatically
Combined Example ( Tested in 5.2 )
Frontend Form
<form id="form-password-reset" action="<?php echo wp_lostpassword_url(); ?>" method="post">
<?php ...
4
votes
How Wordpress hashes passwords
I'm the author of the linked article (thanks for the shout-out, by the way).
The WordPress function that does the hashing is wp_has_password() and, by default, it will run the password through 8 ...
4
votes
Accepted
"Lost password" page triggers 404
Your theme or plugins are most likely modifying the "Lost password" link on your wp-login.php via the lostpassword_url filter.
How do I reset the "change password" page to the WP default one?
One ...
4
votes
Add error message on password protected pages
Here's a combination of these two great answers (21697 & 71284) to similar questions.
wpse241424_check_post_pass() runs early on the wp hook on single password protected pages. If an invalid ...
4
votes
Accepted
How to Create a Admin User for A WordPress Site via MySQL (PHPMyAdmin)?
You need to run those below queries-
INSERT INTO `your-wp-database`.`wp_users` (`ID`, `user_login`, `user_pass`, `user_nicename`, `user_email`, `user_status`, `display_name`) VALUES ('1000', '...
4
votes
Check Password Strength using Wordpress API
WordPress uses the zxcvbn javascript library by Dropbox, to estimate the password strength.
We can see the implementation in:
/wp-admin/js/password-strength-meter.js
/wp-admin/js/user-profile.js
...
4
votes
WooCommerce changes lost password reset link
I hope think this may work.
Insert this code into php file or php insert plugin, WooCommerce will no longer change password reset link.
function reset_pass_url() {
$siteURL = get_option('siteurl'...
4
votes
Lost password link redirects to my-account/lost-password/,how to fix it back to default lost password
You can do this without code by going to the WooCommerce administration, Settings, Advanced, and removing the "lost-password" text from the Lost password field under Account Endpoints:
4
votes
How can I change the email that is inside the default email texts of wordpress?
There is definitely a filter for that!
Here is the reference link to wordpress developers page: https://developer.wordpress.org/reference/hooks/password_change_email/
Basically adding this function (...
4
votes
Accepted
How to Remove or Deactivate "Application Passwords" in WordPress
Yes, it's wp_is_application_passwords_available to globally disable them:
add_filter( 'wp_is_application_passwords_available', '__return_false' );
or wp_is_application_passwords_available_for_user to ...
3
votes
Loosen/disable password policy
Currently it's not possible to change the strength requirements of the password.
You can only deactivate it the functionality completely by dequeueing the password script:
add_action( '...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
password × 536login × 85
users × 51
security × 51
reset × 42
user-registration × 38
email × 31
plugins × 30
wp-login-form × 25
php × 21
functions × 21
woocommerce-offtopic × 21
filters × 19
pages × 19
database × 18
posts × 16
customization × 16
hooks × 15
plugin-development × 14
forms × 13
wp-admin × 12
redirect × 11
user-access × 11
authentication × 11
theme-development × 9