Skip to main content
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
alo Malbarez's user avatar
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() ...
bosco's user avatar
  • 6,865
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)...
ermSO's user avatar
  • 331
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 ...
Piyush Rawat's user avatar
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("...
Luke Seall's user avatar
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 ...
Fayaz's user avatar
  • 8,947
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 ...
butlerblog's user avatar
  • 5,021
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 ...
Toskan's user avatar
  • 524
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 ...
Nathaniel Flick's user avatar
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('...
Chris Rae's user avatar
  • 291
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 ...
birgire's user avatar
  • 67.6k
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 ...
Jeremy Ross's user avatar
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 ) ) ...
Karadjordje's user avatar
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 ...
David Lee's user avatar
  • 3,931
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' );...
Stan Derksen's user avatar
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 ...
Trisha's user avatar
  • 428
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 )...
Krzysiek Dróżdż's user avatar
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 &...
Kshitij Kumar's user avatar
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 ...
Valerii Vasyliev's user avatar
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 ...
inrsaurabh's user avatar
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 ...
EAMann's user avatar
  • 32.1k
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 ...
birgire's user avatar
  • 67.6k
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 ...
Dave Romsey's user avatar
  • 17.8k
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', '...
CodeMascot's user avatar
  • 4,537
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 ...
birgire's user avatar
  • 67.6k
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'...
jaze's user avatar
  • 90
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:
Dan Wich's user avatar
  • 251
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 (...
rudtek's user avatar
  • 6,238
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 ...
Rup's user avatar
  • 4,342
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( '...
Michael Schober's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible