I fixed it. We need decode url with esc_url_raw. Here is solution.
<?php
$user_data = get_user_by( 'email', '[email protected]' ) );
$key = get_password_reset_key( $user_data );
$user_login = $user_data->user_login;
$url = esc_url_raw( get_permalink( '1' ) . "?action=rp&key=$key&login=" . rawurlencode($user_login) ) . "\r\n";
$message = $url;
wp_mail( $user_email, "Title", $message );
?>
Related Posts:
- wordpress redirect after password reset
- Force all users in MU to change their passwords
- Reseting admin password through PHPMyadmin fails
- Reset password – set minimum length for new password
- Password reset message – change the network_home_url( ‘/’ )
- Lost password link is redirecting to /shop/my-account/lost-password/
- password recovery key is invalid on custom reset
- Send password to user instead of reset password link
- How to change “Reset Password” text on submit button
- Customize retrieve password message
- How to initiate password reset flow by code
- WooCommerce Lost Password reset goes to 404
- I have to reset the admin password each time
- Sending Reset Password email via Web API
- Problem with login / reset password links in users emails
- How to set password from frontend if have activation key and user login in url in wordpress?
- mysql update user’s password and activation key
- Reset Password – change from name and email address. It stucks at admin. Want to change it to info
- How to Disable Pre-population of Password on Password Reset
- How to change user password with wp-cli?
- Disable user registration password email
- Loosen/disable password policy
- Password Protect Custom Page
- How do I create a password reset link?
- How can I change the default wordpress password hashing system to something custom?
- If I change the salt keys in my wp-config will all passwords break?
- Conditional to test if post has password protection enabled
- Check the password of a user
- How to add Wp_error using lostpassword_post hook when validating custom field?
- Create a USERNAME and PASSWORD protected WordPress page
- Forgot password not working
- wp_hash_password unexpected behaviour
- Redirect a password protected page?
- WordPress: force users to change password on first login
- Can’t login to wordpress despite changing password to something known directly in MySQL or using “Password Reset by Email” feature
- Change default recovery link expiration time
- Password protect custom template
- Custom password generator for users
- Password protecting template, secured content not showing if even password is right
- How validate usernames/passwords against WP’s database?
- WordPress reset password returns invalid key
- Password reset bug? – “Sorry, that key does not appear to be valid”
- How to set minimum length and error message for password recovery?
- Why is resetting the WordPress Users password not working?
- Customize reset password form redirect problem
- How Authentication in wordpress works? wp_authenticate_username_password()
- Password protection for page template
- Custom login form for front-end user as well as admin
- Enable Update button only when password is shown strong
- How to get user password before being encrypted outside the wordpress core once add a new user from dashboard?
- Adding parameters to password reset key
- How to limit the number of forgot password reset attempts in WordPress?
- wp_hash_password create a different hash everytime
- Custom password form allows unlock two posts with the same password
- How to change password
- Generating the password reset link automatically
- Password protect pages – allow more than one password
- Like to store multiple passwords in db table wp_posts field post_password?
- Password Protected Post is invisible until you login
- Protect Passwords in wp_users with stronger protection than MD5
- How secure is a wp-config file?
- How to Remove or Deactivate “Application Passwords” in WordPress
- How to recover password from a user
- resend user login & password with custom button
- Woocommerce password Reset
- Redirecting to a custom forgot password page
- How to show my wordpress admin username & password?
- Can’t alter $lostpassword_url
- current user’s password check
- How to read third party cookie to access password protected pages
- Ask logged in user to re-enter password to access page “x”
- Password Protect or IP to access under development WordPress site otherwise shown a placeholder page
- Password protected sites
- 2 accounts under same email preventing me from loging in
- Site only for users authenticated by different PHP application
- I need help with wp_lostpassword, wp_register and wp_login_form
- Reset WordPress admin users to limit access
- I can’t recover my password
- Frontend custom forgot password page
- Cannot get function.php code to work to remove Lost Password link on live site
- WordPress password reset not working
- Allow users from my ASP.Net MVC site to access my private WordPress site
- WordPress Protected Page Redirects to PDF
- Custom page password recovery
- Can I use core passworded page/post functions outside of wp-login.php?
- Is it possible to display newly generated password after wp_generate_password()?
- Password protect wp-login.php
- Error when send reset password
- Alter the reset password link
- Is it possible to have users register without having a password?
- Password Protection for posts and pages [duplicate]
- Cant login, Password MUST be reset error, after reset
- WordPress reset password button not working
- Override the default password length when creating or updating a user profile
- Better way to change the default password reset url with the woocommerce one?
- Why can’t I create an Application Password?
- ‘random_password’ filters not taking effect
- How can I redirect the user to the page they were on when they clicked “Lost Password” using “retrieve_password_message” filter
- Bypass a WordPress Password Protected Page via url
- password reset link not being sent