Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6916433
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T09:36:09+00:00 2026-05-27T09:36:09+00:00

How can I verify the old password from the database before updating the new

  • 0

How can I verify the old password from the database before updating the new one in WordPress. The POST variable brings the following data from the update password pages form.

Array
(
    [old_password] => oldpass
    [new_password] => newpass
    [confirm_password] => newpass
)

Is there any default function which will handle this password update matter. What is the encryption method wordpress follows to encrypt the password?

I am still new to wordpress and couldn’t find any solve after googling this requirement. Please direct me to a solve.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T09:36:10+00:00Added an answer on May 27, 2026 at 9:36 am

    I had the similar problem and I have solved it, Here is the solve you can follow, it works good and I have already used it for my own project. Please let me know if you stuck with it.

    if( $_POST['submitpassword'] )
    {
        $passdata = $_POST;
        unset($_POST,$passdata['submitpassword']);
    
        $user = wp_get_current_user(); //trace($user);
        $x = wp_check_password( $passdata['old_password'], $user->user_pass, $user->data->ID );
    
        if($x)
        {
            if( !empty($passdata['new_password']) && !empty($passdata['confirm_password']))
            {
                if($passdata['new_password'] == $passdata['confirm_password'])
                {
                    $udata['ID'] = $user->data->ID;
                    $udata['user_pass'] = $passdata['new_password'];
                    $uid = wp_update_user( $udata );
                    if($uid) 
                    {
                        $passupdatemsg = "The password has been updated successfully";
                        $passupdatetype = 'successed';
                        unset($passdata);
                    } else {
                        $passupdatemsg = "Sorry! Failed to update your account details.";
                        $passupdatetype = 'errored';
                    }
                }
                else
                {
                    $passupdatemsg = "Confirm password doesn't match with new password";
                    $passupdatetype = 'errored';
                }
            }
            else
            {
                $passupdatemsg = "Please enter new password and confirm password";
                $passupdatetype = 'errored';
            }
        } 
        else 
        {
            $passupdatemsg = "Old Password doesn't match the existing password";
            $passupdatetype = 'errored';
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have customers who are upgrading from one database version to another (Oracle 9i
How can I verify a given xpath string is valid in C#/.NET? I'm not
How can I verify an X509 (or DER-formatted) certificate against the Java certificate store
How can I make a verify error for this command? if blablablabla: os.makedirs('C:\\test\\') If
Can anybody help me in finding out how to verify that _tmkdir succeeded. For
I would like to know how I can verify a user's credential against an
Are there any tools that can verify whether a jQuery plugin will be compatible
How to get number range in java? for instance how can verify is the
I'm trying to do cast a List to an IEnumerable, so I can verify
Some links on our page open in a new window using target=_blank. How can

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.