{"id":32725,"date":"2013-03-14T19:29:15","date_gmt":"2013-03-14T13:59:15","guid":{"rendered":"https:\/\/www.quickonlinetips.com\/archives\/?p=32725"},"modified":"2026-10-13T13:41:44","modified_gmt":"2026-10-13T08:11:44","slug":"how-to-use-emergency-wordpress-password-reset-script","status":"publish","type":"post","link":"https:\/\/www.quickonlinetips.com\/archives\/2013\/03\/how-to-use-emergency-wordpress-password-reset-script\/","title":{"rendered":"How to Use the Emergency WordPress Password Reset Script (2026)"},"content":{"rendered":"<p>Locked out of WordPress and the password reset email never arrives? The emergency WordPress password reset script is a last-resort fix that changes the admin password from a single PHP file. In 2013 it saved us when we couldn&#8217;t log in to one of our smaller blogs. The script is still in the official WordPress documentation in 2026, but there are now quicker, safer options to try first. Here&#8217;s how to use the emergency password reset script and what to check afterwards.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-32727\" src=\"https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/forgot-wp-password.png\" alt=\"WordPress password reset script\" width=\"335\" height=\"358\" srcset=\"https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/forgot-wp-password.png 335w, https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/forgot-wp-password-280x300.png 280w\" sizes=\"(max-width: 335px) 100vw, 335px\" \/><\/p>\n<p><strong>Quick answer:<\/strong> To use the emergency password reset script, copy the script from WordPress&#8217;s <a href=\"https:\/\/wordpress.org\/documentation\/article\/reset-your-password\/\" target=\"_blank\" rel=\"noopener\">Reset Your Password<\/a> page, save it as <code>emergency.php<\/code>, upload it to your WordPress root folder, open <code>yoursite.com\/emergency.php<\/code>, enter the admin username and a new password, then log in and <strong>delete emergency.php immediately<\/strong>. Try phpMyAdmin, WP-CLI or your host&#8217;s panel first if you have access.<\/p>\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_89 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-6ad72e9497fe4\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"ez-toc-cssicon\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #1a202c;color:#1a202c\" 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: #1a202c;color:#1a202c\" 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-6ad72e9497fe4\" 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:\/\/www.quickonlinetips.com\/archives\/2013\/03\/how-to-use-emergency-wordpress-password-reset-script\/#What_happened_to_us\" >What happened to us<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2013\/03\/how-to-use-emergency-wordpress-password-reset-script\/#How_to_use_the_WordPress_password_reset_script\" >How to use the WordPress password reset script<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2013\/03\/how-to-use-emergency-wordpress-password-reset-script\/#Faster_ways_to_reset_a_WordPress_password\" >Faster ways to reset a WordPress password<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2013\/03\/how-to-use-emergency-wordpress-password-reset-script\/#Why_the_WordPress_reset_email_doesnt_arrive\" >Why the WordPress reset email doesn&#8217;t arrive<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2013\/03\/how-to-use-emergency-wordpress-password-reset-script\/#After_you_get_back_in\" >After you get back in<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2013\/03\/how-to-use-emergency-wordpress-password-reset-script\/#Frequently_asked_questions\" >Frequently asked questions<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2013\/03\/how-to-use-emergency-wordpress-password-reset-script\/#Is_the_emergency_password_reset_script_safe\" >Is the emergency password reset script safe?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2013\/03\/how-to-use-emergency-wordpress-password-reset-script\/#Do_I_need_the_admin_username_to_use_the_script\" >Do I need the admin username to use the script?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2013\/03\/how-to-use-emergency-wordpress-password-reset-script\/#Will_resetting_the_password_log_out_other_users\" >Will resetting the password log out other users?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2013\/03\/how-to-use-emergency-wordpress-password-reset-script\/#Why_did_my_WordPress_password_stop_working\" >Why did my WordPress password stop working?<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n<h2><span class=\"ez-toc-section\" id=\"What_happened_to_us\"><\/span>What happened to us<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>One morning the admin password on a small QOT blog simply stopped working. The &#8220;Lost your password?&#8221; link said an email was sent, but nothing arrived. Fearing a <a href=\"https:\/\/www.quickonlinetips.com\/archives\/2010\/07\/qot-hacked\/\">hack like the one we survived in 2010<\/a>, we used the emergency script and were back in within minutes. The cause surprised us: the admin account&#8217;s email address belonged to a former admin, so he was receiving our reset emails. Lesson learnt: keep admin emails up to date.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"How_to_use_the_WordPress_password_reset_script\"><\/span>How to use the WordPress password reset script<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<ol>\n<li><strong>Copy the script:<\/strong> open the <strong>Using the Emergency Password Reset Script<\/strong> section of the official Reset Your Password page and copy the code into a plain text editor.<\/li>\n<li><strong>Save it<\/strong> as <code>emergency.php<\/code>.<\/li>\n<li><strong>Upload it<\/strong> to your WordPress root folder (where <code>wp-config.php<\/code> is) using your host&#8217;s File Manager or an FTP client. Don&#8217;t put it in the plugins folder.<\/li>\n<li><strong>Open it<\/strong> in your browser: <code>https:\/\/yoursite.com\/emergency.php<\/code>.<\/li>\n<li><strong>Enter<\/strong> the administrator username and a new strong password, then submit. The script updates the password and emails the admin address.<\/li>\n<li><strong>Log in<\/strong> at <code>\/wp-admin<\/code> with the new password.<\/li>\n<li><strong>Delete emergency.php<\/strong> from the server right away. Anyone who finds it could reset your password.<\/li>\n<\/ol>\n<h2><span class=\"ez-toc-section\" id=\"Faster_ways_to_reset_a_WordPress_password\"><\/span>Faster ways to reset a WordPress password<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<ul>\n<li><strong>Your host&#8217;s control panel:<\/strong> many hosts, including Hostinger&#8217;s hPanel and cPanel&#8217;s WordPress Toolkit, let you change the admin password in a couple of clicks.<\/li>\n<li><strong>phpMyAdmin:<\/strong> edit the <code>user_pass<\/code> field in the <code>wp_users<\/code> table. We explain each step in <a href=\"https:\/\/www.quickonlinetips.com\/archives\/2021\/09\/change-wordpress-password\/\">how to change a WordPress password with phpMyAdmin<\/a>.<\/li>\n<li><strong>WP-CLI:<\/strong> if you have SSH access, run <code>wp user update admin --user_pass=\"NewStrongPassword\"<\/code>.<\/li>\n<li><strong>functions.php:<\/strong> temporarily add <code>wp_set_password( 'NewPassword', 1 );<\/code> to your theme&#8217;s functions.php, load the site once, then remove the line.<\/li>\n<\/ul>\n<h2><span class=\"ez-toc-section\" id=\"Why_the_WordPress_reset_email_doesnt_arrive\"><\/span>Why the WordPress reset email doesn&#8217;t arrive<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<ul>\n<li><strong>Wrong or old email<\/strong> on the admin account, as in our case.<\/li>\n<li><strong>Server mail blocked or sent to spam:<\/strong> many hosts limit PHP mail. Install an SMTP plugin and send through a proper email service.<\/li>\n<li><strong>Security plugins<\/strong> or a firewall blocking the login or reset page.<\/li>\n<\/ul>\n<h2><span class=\"ez-toc-section\" id=\"After_you_get_back_in\"><\/span>After you get back in<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<ul>\n<li>Check <strong>Users<\/strong> for unknown admin accounts and update every admin&#8217;s email.<\/li>\n<li>Turn on two-factor authentication, and use a password manager.<\/li>\n<li>Make sure you have recent backups; see how to <a href=\"https:\/\/www.quickonlinetips.com\/archives\/2015\/02\/backup-websites-on-hosting-server\/\">back up websites on your hosting server<\/a>.<\/li>\n<\/ul>\n<h2><span class=\"ez-toc-section\" id=\"Frequently_asked_questions\"><\/span>Frequently asked questions<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3><span class=\"ez-toc-section\" id=\"Is_the_emergency_password_reset_script_safe\"><\/span>Is the emergency password reset script safe?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>It&#8217;s safe only while you use it. Delete the file immediately afterwards, because anyone who knows an admin username could use it.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Do_I_need_the_admin_username_to_use_the_script\"><\/span>Do I need the admin username to use the script?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Yes. The script asks for the administrator&#8217;s username. If you&#8217;ve forgotten it, check the <code>wp_users<\/code> table in phpMyAdmin.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Will_resetting_the_password_log_out_other_users\"><\/span>Will resetting the password log out other users?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>It changes only that account&#8217;s password and logs out that user&#8217;s sessions.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Why_did_my_WordPress_password_stop_working\"><\/span>Why did my WordPress password stop working?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Usually a typo, caps lock, a changed account email, or a compromised site. If you suspect a hack, change all passwords and scan the site.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Locked out of WordPress and the password reset email never arrives? The emergency WordPress password reset script is a last-resort&#8230;<\/p>\n","protected":false},"author":4,"featured_media":32727,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_kad_post_transparent":"default","_kad_post_title":"default","_kad_post_layout":"default","_kad_post_sidebar_id":"","_kad_post_content_style":"default","_kad_post_vertical_padding":"default","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"_kad_post_classname":"","footnotes":""},"categories":[6,7],"tags":[49,17],"class_list":["post-32725","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blogging","category-security","tag-tutorials","tag-wordpress"],"_links":{"self":[{"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/posts\/32725","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/comments?post=32725"}],"version-history":[{"count":3,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/posts\/32725\/revisions"}],"predecessor-version":[{"id":65474,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/posts\/32725\/revisions\/65474"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/media\/32727"}],"wp:attachment":[{"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/media?parent=32725"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/categories?post=32725"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/tags?post=32725"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}