emergency password reset script wordpress

  1. Access your website's files via cPanel or FTP.
  2. Navigate to the theme's functions.php file.
  3. Add the following code at the beginning of the file:
wp_set_password( 'new_password', 1 );

Replace 'new_password' with your desired password. 4. Save the changes to the functions.php file. 5. Remove the added code from the functions.php file to prevent any security risks. 6. Log in to your WordPress using the new password set in step 3.