{"id":315271,"date":"2021-08-05T12:00:00","date_gmt":"2021-08-05T09:00:00","guid":{"rendered":"https:\/\/en.buradabiliyorum.com\/how-to-manually-reset-a-wordpress-password-in-the-database-cloudsavvy-it\/"},"modified":"2021-08-05T12:00:00","modified_gmt":"2021-08-05T09:00:00","slug":"how-to-manually-reset-a-wordpress-password-in-the-database-cloudsavvy-it","status":"publish","type":"post","link":"https:\/\/buradabiliyorum.com\/en\/how-to-manually-reset-a-wordpress-password-in-the-database-cloudsavvy-it\/","title":{"rendered":"#How to Manually Reset a WordPress Password in the Database \u2013 CloudSavvy IT"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_84 counter-hierarchy ez-toc-counter ez-toc-custom ez-toc-container-direction\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<label for=\"ez-toc-cssicon-toggle-item-6a2c363dbef04\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #dd3333;color:#dd3333\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #dd3333;color:#dd3333\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-6a2c363dbef04\" checked aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/buradabiliyorum.com\/en\/how-to-manually-reset-a-wordpress-password-in-the-database-cloudsavvy-it\/#Reset_the_Password_from_MySQL\" >Reset the Password from MySQL<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/buradabiliyorum.com\/en\/how-to-manually-reset-a-wordpress-password-in-the-database-cloudsavvy-it\/#If_You_Dont_Have_MySQL_Access\" >If You Don\u2019t Have MySQL Access<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/buradabiliyorum.com\/en\/how-to-manually-reset-a-wordpress-password-in-the-database-cloudsavvy-it\/#Reset_with_an_Email_Link\" >Reset with an Email Link<\/a><\/li><\/ul><\/nav><\/div>\n<p><strong>&#8220;#How to Manually Reset a WordPress Password in the Database \u2013 CloudSavvy IT&#8221;<\/strong><\/p>\n<div id=\"article-content-area\">\n<img loading=\"lazy\" decoding=\"async\" class=\"type:primaryImage imgchk9 alignnone wp-image-1260 size-full\" srcset=\"https:\/\/www.cloudsavvyit.com\/p\/uploads\/2019\/07\/f58e5f74.png?width=398&amp;trim=1,1&amp;bg-color=000&amp;pad=1,1 400w, https:\/\/www.cloudsavvyit.com\/p\/uploads\/2019\/07\/f58e5f74.png?width=1198&amp;trim=1,1&amp;bg-color=000&amp;pad=1,1 1200w\" sizes=\"auto, 400w, 1200w\" src=\"https:\/\/www.cloudsavvyit.com\/p\/uploads\/2019\/07\/f58e5f74.png?width=1198&amp;trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"WordPress logo.\" width=\"700\" height=\"300\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>If you\u2019ve gotten locked out of your WordPress instance, you can always reset your password by manually editing the table that it uses to store passwords in, provided you have access to the MySQL database.<\/p>\n<h2 role=\"heading\" aria-level=\"2\"><span class=\"ez-toc-section\" id=\"Reset_the_Password_from_MySQL\"><\/span>Reset the Password from MySQL<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>WordPress runs on PHP, and uses MySQL to store data about posts, configuration, and everything else, including passwords. It stores passwords using\u00a0the PHPass PHP library (though you can change this with <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/wordpress.org\/plugins\/password-hash\/\">plugins<\/a>). But, because of backward compatibility, it will still accept an MD5 hash, which is easy to generate (and definitely not secure). You can manually replace your current password with a new MD5 hash.<\/p>\n<p>You\u2019ll need to have access to MySQL to perform these steps. If you have command line access to the server, you can log in to MySQL with:<\/p>\n<pre>mysql -u root -p<\/pre>\n<p>And select the WordPress database (the name is usually defined in <code>wp-config.php<\/code>; otherwise, you can use the <code>show databases<\/code>\u00a0command):<\/p>\n<pre>select\u00a0database1_wp123<\/pre>\n<p>If you don\u2019t have command line access (as is the case with shared hosting), you might have phpMyAdmin installed; if so, you can use that web interface to perform the same commands without SSH access.<\/p>\n<p>Enter the following command, replacing <code>'new_password'<\/code>\u00a0with the password you\u2019d like to set and replacing <code>'admin'<\/code>\u00a0with the username of the account you\u2019re editing (which may very well be \u2018admin\u2019):<\/p>\n<pre>UPDATE `wp_users` SET `user_pass` = MD5( 'new_password' ) WHERE `wp_users`.`user_login` = \"admin\";<\/pre>\n<p>Your table may be named something different; if so, you can list all tables with the <code>show tables<\/code>\u00a0command.<\/p>\n<p>Exit MySQL with Control+D, and verify that the password change worked by attempting to log in.<\/p>\n<p>When you log in again, your password will match the newly created MD5 hash and WordPress should let you log in. WordPress will also go ahead and rehash your password using the default hashing algorithm, and update the database accordingly.<\/p>\n<h2 role=\"heading\" aria-level=\"2\"><span class=\"ez-toc-section\" id=\"If_You_Dont_Have_MySQL_Access\"><\/span>If You Don\u2019t Have MySQL Access<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>If you have FTP access and the ability to modify WordPress\u2019s files, you can reset the password this way. There should be a file called <code>functions.php<\/code> in your active <a href=\"https:\/\/buradabiliyorum.com\/en\/category\/download-scripts-themes-apps\/\" data-internallinksmanager029f6b8e52c=\"9\" title=\"Download Scripts &amp; Themes &amp; Apps\" target=\"_blank\" rel=\"noopener\">theme<\/a>\u2019s files (under <code>wp-content\/themes\/theme-name\/<\/code>). Download this file, and add the following line after <code>&lt;?php<\/code>:<\/p>\n<pre>wp_set_password( 'password', 1 );<\/pre>\n<p>This will reset the password for the user with ID \u201c1.\u201d This resets on every page load, so you\u2019ll want to remove it once you can regain access.<\/p>\n<h2 role=\"heading\" aria-level=\"2\"><span class=\"ez-toc-section\" id=\"Reset_with_an_Email_Link\"><\/span>Reset with an Email Link<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>This does require you to have a command line mail agent like Postfix set up and working, or else WordPress won\u2019t be able to send any emails.<\/p>\n<p>On the WordPress login page, there\u2019s a link at the bottom to trigger an email password reset. Click this, enter your email, then reset your password using the link given to you.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"imgchk9 alignnone wp-image-1492 size-full\" src=\"https:\/\/www.cloudsavvyit.com\/p\/uploads\/2019\/08\/f30e26a2.png?trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"Link at the bottom to trigger an email password reset.\" width=\"700\" height=\"300\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>You can use this method to trigger password resets for other users, too; just enter their email instead, which will send them the link to reset their own password.\n<\/p><\/div>\n<blockquote><p><strong><span style=\"color: #ff6600;\">If you liked the article, do not forget to share it with your friends. Follow us on\u00a0<span style=\"color: #ff0000;\"><a style=\"color: #ff0000;\" href=\"https:\/\/news.google.com\/publications\/CAAqBwgKMLG0nwswvr63Aw\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">Google News<\/a><\/span>\u00a0too, click on the star and choose us from your favorites.<\/span><\/strong><\/p><\/blockquote>\n<blockquote>\n<p style=\"text-align: center;\">For forums sites go to <span style=\"color: #ff9900;\"><a style=\"color: #ff9900;\" href=\"https:\/\/forum.buradabiliyorum.com\/\" target=\"_blank\" rel=\"noopener\">Forum.BuradaBiliyorum.Com<\/a><\/span><\/strong><\/p>\n<\/blockquote>\n<blockquote>\n<p style=\"text-align: center;\"><strong>If you want to read more like this article, you can visit our <span style=\"color: #ff9900;\"><a style=\"color: #ff9900;\" href=\"https:\/\/en.buradabiliyorum.com\/technology\/\" target=\"_blank\" rel=\"noopener\">Technology category.<\/a><\/span><\/strong><\/p>\n<\/blockquote>\n<p><span style=\"color: black;\"><a style=\"color: #ff9900;\" href=\"https:\/\/www.cloudsavvyit.com\/1491\/how-to-manually-reset-a-wordpress-password-in-the-database\/\" target=\"_blank\" rel=\"noopener\">Source<\/a><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>&#8220;#How to Manually Reset a WordPress Password in the Database \u2013 CloudSavvy IT&#8221; If you\u2019ve gotten locked out of your WordPress instance, you can always reset your password by manually editing the table that it uses to store passwords in, provided you have access to the MySQL database. Reset the Password from MySQL WordPress runs&#8230;<\/p>\n","protected":false},"author":1,"featured_media":315272,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"fifu_image_url":"https:\/\/www.cloudsavvyit.com\/p\/uploads\/2019\/07\/f58e5f74.png","fifu_image_alt":"","footnotes":""},"categories":[18],"tags":[],"class_list":["post-315271","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-technology"],"_links":{"self":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/posts\/315271","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/comments?post=315271"}],"version-history":[{"count":0,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/posts\/315271\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/media\/315272"}],"wp:attachment":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/media?parent=315271"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/categories?post=315271"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/tags?post=315271"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}