{"id":2753,"date":"2022-01-24T11:28:11","date_gmt":"2022-01-24T09:28:11","guid":{"rendered":"https:\/\/www.scalahosting.com\/kb\/?p=2753"},"modified":"2022-03-15T15:36:58","modified_gmt":"2022-03-15T13:36:58","slug":"how-to-reset-your-wordpress-password","status":"publish","type":"post","link":"https:\/\/www.scalahosting.com\/kb\/how-to-reset-your-wordpress-password\/","title":{"rendered":"How to Reset Your WordPress Password?"},"content":{"rendered":"<p><b>Working with WordPress<\/b><span style=\"font-weight: 400;\">, there are some essential commands you need to master to ensure you can easily handle your day-to-day activities. After all, even if you are a complete beginner, you have to be <\/span><a href=\"https:\/\/www.scalahosting.com\/kb\/how-to-create-a-wordpress-website-for-beginners\/\"><b>acquainted with the basics<\/b><\/a><span style=\"font-weight: 400;\">.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Today&#8217;s guide will teach you more about the importance of your WordPress passwords and how to quickly reset them through various methods.\u00a0<\/span><\/p>\n<h2><b>When Do You Need to Reset Your WordPress Password?<\/b><\/h2>\n<p><span style=\"font-weight: 400;\">There are numerous reasons why you might want to change or reset your WP passkey in the process of working with the app.\u00a0 For example, you can be an outside author who was given auto-generated credentials, and you might want to switch them to something more memorable. As <\/span><a href=\"https:\/\/www.scalahosting.com\/blog\/wordpress-vs-other-content-management-systems\/\"><b>WordPress is a CMS<\/b><\/a><span style=\"font-weight: 400;\"> that lures in a lot of hackers, it&#8217;s not uncommon to have to switch your password to avoid an emerging vulnerability or suspected breach.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">But the biggest reason in favor of <\/span><b>frequently changing your WordPress login credentials<\/b><span style=\"font-weight: 400;\"> is even more simple and obvious &#8211; <\/span><b>better overall security<\/b><span style=\"font-weight: 400;\">. Even if your passwords are complex enough, it&#8217;s a good idea to switch them around from time to time. This way, you can prevent them from falling into some black market list of stolen credentials and causing tons of headaches in the long run.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">With that in mind, here are some of the most <\/span><b>common ways to reset a WP password<\/b><span style=\"font-weight: 400;\">.<\/span><\/p>\n<h2><b>How to Reset Your WordPress Password via the Automatic Emailer<\/b><\/h2>\n<p><span style=\"font-weight: 400;\">This one is as easy as they come. Pretty much any online user has forgotten a password at least once, and the process of retrieving it is quite similar on many websites.\u00a0<\/span><\/p>\n<ol>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Go to your <\/span><b>WordPress admin page<\/b><span style=\"font-weight: 400;\"> (default is yourdomain.com\/wp-admin)<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Click on the blue link <\/span><b>Forgot Your Password<\/b><span style=\"font-weight: 400;\">.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Now, input either your <\/span><b>WP username<\/b><span style=\"font-weight: 400;\"> or <\/span><b>WP<\/b> <b>email address<\/b><span style=\"font-weight: 400;\"> to verify your identity.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">You can go ahead and<\/span><b> log into your email account<\/b><span style=\"font-weight: 400;\">.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Follow the link and type in your new password. Then <\/span><b>retype to confirm.<\/b><\/li>\n<\/ol>\n<h2><b>How to Reset Your WordPress Password via the MySQL Command Line<\/b><\/h2>\n<p><span style=\"font-weight: 400;\">You can also access WP&#8217;s database through the command-line interface and reset your password from there. Bear in mind, however, that this requires root MySQL access, which isn&#8217;t available on all plans.<br \/>\n<\/span><\/p>\n<ol>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Create a new text file<\/b><span style=\"font-weight: 400;\"> that contains the new password. You can do that by typing:<\/span><\/li>\n<\/ol>\n<p class=\"alert-orange\"><span style=\"font-weight: 400;\"># vi newpassword.txt<\/span><\/p>\n<ol start=\"2\">\n<li><span style=\"font-weight: 400;\">We now need to <\/span><a href=\"https:\/\/www.scalahosting.com\/blog\/how-does-wordpress-hash-passwords\/\"><b>create an MD5 hash string<\/b><\/a><span style=\"font-weight: 400;\"> for the new password. To do so, use the command:<\/span><\/li>\n<\/ol>\n<p class=\"alert-orange\"><span style=\"font-weight: 400;\"># tr -d \u2018\\r\\n\u2019 &lt; wp.txt | md5sum | tr -d &#8216;-&#8216;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Save the newly-generated string to your local computer. Additionally, you can <\/span><b>delete the text file for extra security<\/b><span style=\"font-weight: 400;\">. The command is:<\/span><\/p>\n<p class=\"alert-orange\"><span style=\"font-weight: 400;\"># rm -rf newpassword.txt<\/span><\/p>\n<ol start=\"3\">\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Now, <\/span><b>login to your MySQL as root<\/b><span style=\"font-weight: 400;\">:<\/span><\/li>\n<\/ol>\n<p class=\"alert-orange\"><span style=\"font-weight: 400;\"># mysql -u root -p<\/span><\/p>\n<ol start=\"4\">\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Find the <\/span><b>correct <\/b><a href=\"https:\/\/www.scalahosting.com\/kb\/how-to-manage-mysql-users-databases-and-tables-from-the-command-line\/\"><b>MySQL database<\/b><\/a><span style=\"font-weight: 400;\">:<\/span><\/li>\n<\/ol>\n<p class=\"alert-orange\"><span style=\"font-weight: 400;\">&gt; show databases;<br \/>\n&gt; use wordpress;<\/span><\/p>\n<ol start=\"5\">\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">The next step is to open it to view its content:<\/span><\/li>\n<\/ol>\n<p class=\"alert-orange\"><span style=\"font-weight: 400;\">&gt; SELECT ID, user_login, user_pass FROM wp_users;<\/span><\/p>\n<ol start=\"6\">\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">You should now be able to see the MD5 string of the current password. We need to <\/span><b>replace it with the one we generated earlier<\/b><span style=\"font-weight: 400;\">. You can do so with the following command:<\/span><\/li>\n<\/ol>\n<p class=\"alert-orange\"><span style=\"font-weight: 400;\">&gt; UPDATE wp_users SET user_pass=(&#8216;newMD5string&#8217;) WHERE user_login = &#8216;admin&#8217;;<\/span><\/p>\n<ol start=\"7\">\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">If you want to <\/span><b>test if the new password has been successfully updated<\/b><span style=\"font-weight: 400;\"> by typing:<\/span><\/li>\n<\/ol>\n<p class=\"alert-orange\"><span style=\"font-weight: 400;\">&gt; SELECT ID, user_login, user_pass FROM wp_users;<\/span><\/p>\n<h2><b>How to Reset Your WordPress Password via phpMyAdmin<\/b><\/h2>\n<ol>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Log in to your <\/span><b>control panel<\/b><span style=\"font-weight: 400;\">.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Find the <\/span><b>phpMyAdmin <\/b><span style=\"font-weight: 400;\">option under the <\/span><b>Databases <\/b><span style=\"font-weight: 400;\">section.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Find your WordPress database and select the <\/span><b>wp_users<\/b><span style=\"font-weight: 400;\"> table on the left. Click <\/span><b>Edit<\/b><span style=\"font-weight: 400;\">.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Input your new password in the <\/span><b>user_pass<\/b><span style=\"font-weight: 400;\"> field and select <\/span><b>MD5 <\/b><span style=\"font-weight: 400;\">from the drop-down.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">When you click <\/span><b>Go<\/b><span style=\"font-weight: 400;\">, the system should return a message that you have successfully updated your database record.\u00a0<\/span><\/li>\n<\/ol>\n<h2><b>How to Reset Your WordPress Password via FTP<\/b><\/h2>\n<ol>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Log in to the <\/span><a href=\"https:\/\/www.scalahosting.com\/kb\/how-to-establish-an-ftp-connection-to-your-hosting-account\/\"><b>FTP client<\/b><\/a><span style=\"font-weight: 400;\"> of your choice.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Navigate to the <\/span><b>functions.php<\/b><span style=\"font-weight: 400;\"> file and download it locally.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">You can now execute the following command:<\/span><\/li>\n<\/ol>\n<p class=\"alert-orange\"><span style=\"font-weight: 400;\">wp_set_password(\u2018<\/span><i><span style=\"font-weight: 400;\">newpassword<\/span><\/i><span style=\"font-weight: 400;\">\u2019,\u2019admin\u2019);<\/span><\/p>\n<ol start=\"4\">\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Next, we need to upload the functions.php file back to our <\/span><b>\/themes<\/b><span style=\"font-weight: 400;\"> folder (or the specific folder you downloaded it from).<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Go ahead and log into your <\/span><a href=\"https:\/\/www.scalahosting.com\/blog\/navigating-your-wordpress-dashboard\/\"><b>WordPress dashboard<\/b><\/a><span style=\"font-weight: 400;\">. Once in, make sure to <\/span><b>remove the wp_set_password line<\/b><span style=\"font-weight: 400;\"> you added in step 3, or it will keep resetting after every page load.<\/span><\/li>\n<\/ol>\n<h2><b>How to Reset Your WordPress Password via WP CLI<\/b><\/h2>\n<p><b>WP CLI basically works like a WordPress terminal<\/b><span style=\"font-weight: 400;\"> that allows you to execute commands. As such, it is predominantly preferred by developers and experienced users. To use WP CLI for your password reset, simply:<\/span><\/p>\n<ol>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Log in and open the <\/span><b>\/wordpress<\/b><span style=\"font-weight: 400;\"> directory.\u00a0<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Once inside, type:<\/span><\/li>\n<\/ol>\n<p class=\"alert-orange\"><span style=\"font-weight: 400;\">$ wp user list<\/span><\/p>\n<p><span style=\"font-weight: 400;\">This will show you <\/span><b>a list of all registered users<\/b><span style=\"font-weight: 400;\"> for your WordPress installation.\u00a0<\/span><\/p>\n<ol start=\"3\">\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Find the ID<\/b><span style=\"font-weight: 400;\"> of the user you are trying to modify and run the following command:<\/span><\/li>\n<\/ol>\n<p class=\"alert-orange\"><span style=\"font-weight: 400;\">$ wp user update userID &#8211;user_pass=newpassword<\/span><\/p>\n<p><span style=\"font-weight: 400;\">You simply need to replace <\/span><i><span style=\"font-weight: 400;\">userID<\/span><\/i><span style=\"font-weight: 400;\"> with the correct user and <\/span><i><span style=\"font-weight: 400;\">newpassword<\/span><\/i><span style=\"font-weight: 400;\"> with the passkey of your choice.\u00a0<\/span><\/p>\n<h2><b>How to Reset Your WordPress Password Using the Emergency Password Reset Script<\/b><\/h2>\n<p><span style=\"font-weight: 400;\">If all else fails, you can always try <\/span><b>utilizing a PHP script<\/b><span style=\"font-weight: 400;\"> that serves this exact purpose &#8211; the Emergency Password Reset Script. To do that, you would need to know the <\/span><b>admin username <\/b><span style=\"font-weight: 400;\">and have access to the <\/span><b>administrative email address<\/b><span style=\"font-weight: 400;\">.\u00a0<\/span><\/p>\n<ol>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Place the script in your <\/span><b>root WordPress folder <\/b><span style=\"font-weight: 400;\">(not the Plugins directory).\u00a0<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Copy the entire <\/span><a href=\"https:\/\/codex.wordpress.org\/User:MichaelH\/Orphaned_Plugins_needing_Adoption\/Emergency\"><b>Emergency Password Reset Script<\/b><\/a><span style=\"font-weight: 400;\"> from the official WordPress repository.\u00a0<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Create a new file in your root WP folder and name it <\/span><b>emergency.php<\/b><span style=\"font-weight: 400;\">. Paste the script inside.\u00a0<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Open the script in your browser by typing:<\/span><\/li>\n<\/ol>\n<p class=\"alert-orange\"><span style=\"font-weight: 400;\">http:\/\/yourdomain.com\/emergency.php<\/span><\/p>\n<ol start=\"5\">\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Enter the <\/span><b>admin username<\/b><span style=\"font-weight: 400;\"> (the default is admin unless you&#8217;ve changed it) along with the <\/span><b>new password<\/b><span style=\"font-weight: 400;\"> you&#8217;ve chosen. Hit <\/span><b>Update Option<\/b><span style=\"font-weight: 400;\">s afterward.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Test if everything works and <\/span><b>delete the emergency.php file<\/b><span style=\"font-weight: 400;\"> afterward.\u00a0<\/span><\/li>\n<\/ol>\n<p class=\"alert-blue\"><b>IMPORTANT: <\/b><span style=\"font-weight: 400;\">The last step is crucial as keeping the Emergency Password Reset Script on your server will leave it vulnerable for any savvy hacker to exploit and lock you out of your WordPress account.\u00a0<\/span><\/p>\n<p><i><span style=\"font-weight: 400;\">We hope this guide has helped you with resetting your WP password and learning more about the most popular CMS<\/span><\/i><span style=\"font-weight: 400;\">.<\/span><i><span style=\"font-weight: 400;\"> If you have more questions &#8211; you can always <\/span><\/i><a href=\"https:\/\/www.scalahosting.com\/contact-us.html\"><b><i>contact the ScalaHosting Support<\/i><\/b><\/a><i><span style=\"font-weight: 400;\"> for assistance.\u00a0<\/span><\/i><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Working with WordPress, there are some essential commands you need to master to ensure you can easily handle your day-to-day activities. After all, even if you are a complete beginner, you have to be acquainted with the basics. Today&#8217;s guide will teach you more about the importance of your WordPress passwords and how to quickly [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_seopress_robots_primary_cat":"","_seopress_titles_title":"","_seopress_titles_desc":"","_seopress_robots_index":"","footnotes":""},"categories":[34],"tags":[],"class_list":["post-2753","post","type-post","status-publish","format-standard","hentry","category-web-hosting"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.scalahosting.com\/kb\/wp-json\/wp\/v2\/posts\/2753","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.scalahosting.com\/kb\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.scalahosting.com\/kb\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.scalahosting.com\/kb\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.scalahosting.com\/kb\/wp-json\/wp\/v2\/comments?post=2753"}],"version-history":[{"count":13,"href":"https:\/\/www.scalahosting.com\/kb\/wp-json\/wp\/v2\/posts\/2753\/revisions"}],"predecessor-version":[{"id":4008,"href":"https:\/\/www.scalahosting.com\/kb\/wp-json\/wp\/v2\/posts\/2753\/revisions\/4008"}],"wp:attachment":[{"href":"https:\/\/www.scalahosting.com\/kb\/wp-json\/wp\/v2\/media?parent=2753"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.scalahosting.com\/kb\/wp-json\/wp\/v2\/categories?post=2753"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.scalahosting.com\/kb\/wp-json\/wp\/v2\/tags?post=2753"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}