[{"data":1,"prerenderedAt":609},["ShallowReactive",2],{"post-\u002Freset-wordpress-admin-password-using-wp-cli":3},{"page":4,"translation":480,"nav":482,"related":595,"random":602},{"id":5,"title":6,"body":7,"categories":461,"category":463,"date":464,"description":465,"draft":466,"extension":467,"image":468,"kind":463,"lang":469,"meta":470,"navigation":471,"path":472,"readingTime":452,"seo":473,"slug":474,"stem":474,"tags":475,"translationKey":474,"type":462,"updated":478,"__hash__":479},"posts\u002Freset-wordpress-admin-password-using-wp-cli.md","Reset WordPress Admin Password Using WP-CLI",{"type":8,"value":9,"toc":448},"minimark",[10,64,67,74,77,82,186,188,193,196,218,228,230,234,237,254,258,268,291,297,314,325,327,331,342,369,375,405,409,416,429,431,435,441,444],[11,12,13,21],"blockquote",{},[14,15,16,17],"p",{},"💡 ",[18,19,20],"strong",{},"Quick Summary (TL;DR):",[22,23,24,31,46],"ul",{},[25,26,27,30],"li",{},[18,28,29],{},"Objective:"," Reset a lost WordPress administrator password directly from the server terminal using WP-CLI.",[25,32,33,36,37,41,42,45],{},[18,34,35],{},"Key Commands:"," Use ",[38,39,40],"code",{},"wp user list"," to find the target admin's ID, then run ",[38,43,44],{},"wp user update \u003CID> --user_pass=\"\u003Cnew_password>\"",".",[25,47,48,51,52,55,56,59,60,63],{},[18,49,50],{},"Gotcha:"," If running as the ",[38,53,54],{},"root"," user, you must append ",[38,57,58],{},"--allow-root"," to the commands or run them as the web server user (",[38,61,62],{},"sudo -u www-data",").",[14,65,66],{},"Misplacing or overlooking a WordPress administrator password is a common challenge for developers and site administrators. While the standard email recovery flow works, it can be slow or fail entirely if your server's mail system (SMTP) is not configured.",[14,68,69,70,73],{},"Using ",[18,71,72],{},"WP-CLI",", a powerful command-line interface for WordPress, you can bypass the email recovery process and reset any user password instantly directly from your server's console.",[75,76],"hr",{},[78,79,81],"h3",{"id":80},"wordpress-admin-password-reset-methods-comparison","WordPress Admin Password Reset Methods Comparison",[83,84,85,108],"table",{},[86,87,88],"thead",{},[89,90,91,96,99,102,105],"tr",{},[92,93,95],"th",{"align":94},"left","Method",[92,97,98],{"align":94},"Access Needed",[92,100,101],{"align":94},"Speed",[92,103,104],{"align":94},"Risk \u002F Difficulty",[92,106,107],{"align":94},"Recommended For",[109,110,111,130,149,168],"tbody",{},[89,112,113,118,121,124,127],{},[114,115,116],"td",{"align":94},[18,117,72],{},[114,119,120],{"align":94},"SSH Access to Server",[114,122,123],{"align":94},"Instant",[114,125,126],{"align":94},"Low (Command-line)",[114,128,129],{"align":94},"Developers & Server Admins",[89,131,132,137,140,143,146],{},[114,133,134],{"align":94},[18,135,136],{},"phpMyAdmin \u002F MySQL",[114,138,139],{"align":94},"Database Access",[114,141,142],{"align":94},"Fast",[114,144,145],{"align":94},"Medium (Requires MD5 hashing)",[114,147,148],{"align":94},"Hosting panel users",[89,150,151,156,159,162,165],{},[114,152,153],{"align":94},[18,154,155],{},"Email Reset",[114,157,158],{"align":94},"Email Inbox Access",[114,160,161],{"align":94},"Slow",[114,163,164],{"align":94},"Low (Standard flow)",[114,166,167],{"align":94},"Client users",[89,169,170,175,178,180,183],{},[114,171,172],{"align":94},[18,173,174],{},"wp-config.php Edit",[114,176,177],{"align":94},"FTP \u002F File Access",[114,179,142],{"align":94},[114,181,182],{"align":94},"High (Involves editing code)",[114,184,185],{"align":94},"Emergencies (no DB\u002FSSH access)",[75,187],{},[189,190,192],"h2",{"id":191},"step-1-locate-your-wordpress-installation","Step 1 — Locate Your WordPress Installation",[14,194,195],{},"Log in to your server via SSH and navigate to the directory where your WordPress site is installed:",[197,198,203],"pre",{"className":199,"code":200,"language":201,"meta":202,"style":202},"language-bash shiki shiki-themes github-light github-dark","cd \u002Fvar\u002Fwww\u002Fmy-website\u002F\n","bash","",[38,204,205],{"__ignoreMap":202},[206,207,210,214],"span",{"class":208,"line":209},"line",1,[206,211,213],{"class":212},"sj4cs","cd",[206,215,217],{"class":216},"sZZnC"," \u002Fvar\u002Fwww\u002Fmy-website\u002F\n",[14,219,220],{},[221,222,223,224,227],"em",{},"(Replace ",[38,225,226],{},"\u002Fvar\u002Fwww\u002Fmy-website\u002F"," with the actual path to your WordPress root directory).",[75,229],{},[189,231,233],{"id":232},"step-2-find-the-target-user-id","Step 2 — Find the Target User ID",[14,235,236],{},"To update a user, you first need their unique ID or username. List all registered users on your site by running:",[197,238,240],{"className":199,"code":239,"language":201,"meta":202,"style":202},"wp user list\n",[38,241,242],{"__ignoreMap":202},[206,243,244,248,251],{"class":208,"line":209},[206,245,247],{"class":246},"sScJk","wp",[206,249,250],{"class":216}," user",[206,252,253],{"class":216}," list\n",[78,255,257],{"id":256},"️-the-root-user-gotcha","⚠️ The Root User Gotcha",[14,259,260,261,263,264,267],{},"If you are logged in to your server as ",[38,262,54],{}," (which is common on VPS environments), WP-CLI will block execution by default for security reasons. You will see an error. To bypass this, either run the command as the web server user (",[38,265,266],{},"www-data"," on Ubuntu\u002FDebian):",[197,269,271],{"className":199,"code":270,"language":201,"meta":202,"style":202},"sudo -u www-data wp user list\n",[38,272,273],{"__ignoreMap":202},[206,274,275,278,281,284,287,289],{"class":208,"line":209},[206,276,277],{"class":246},"sudo",[206,279,280],{"class":212}," -u",[206,282,283],{"class":216}," www-data",[206,285,286],{"class":216}," wp",[206,288,250],{"class":216},[206,290,253],{"class":216},[14,292,293,294,296],{},"Or append the ",[38,295,58],{}," flag to your command:",[197,298,300],{"className":199,"code":299,"language":201,"meta":202,"style":202},"wp user list --allow-root\n",[38,301,302],{"__ignoreMap":202},[206,303,304,306,308,311],{"class":208,"line":209},[206,305,247],{"class":246},[206,307,250],{"class":216},[206,309,310],{"class":216}," list",[206,312,313],{"class":212}," --allow-root\n",[14,315,316,317,320,321,324],{},"Identify the ",[38,318,319],{},"ID"," of the administrator account you want to modify (usually ",[38,322,323],{},"1"," for the initial administrator, but verify this from the table output).",[75,326],{},[189,328,330],{"id":329},"step-3-update-the-password","Step 3 — Update the Password",[14,332,333,334,337,338,341],{},"Run the update command below. Replace ",[38,335,336],{},"[USER_ID]"," with the actual ID you found in Step 2, and ",[38,339,340],{},"[NEW_SECURE_PASSWORD]"," with your new password:",[197,343,345],{"className":199,"code":344,"language":201,"meta":202,"style":202},"wp user update [USER_ID] --user_pass=\"[NEW_SECURE_PASSWORD]\" --allow-root\n",[38,346,347],{"__ignoreMap":202},[206,348,349,351,353,356,360,364,367],{"class":208,"line":209},[206,350,247],{"class":246},[206,352,250],{"class":216},[206,354,355],{"class":216}," update",[206,357,359],{"class":358},"sVt8B"," [USER_ID] --user_pass",[206,361,363],{"class":362},"szBVR","=",[206,365,366],{"class":216},"\"[NEW_SECURE_PASSWORD]\"",[206,368,313],{"class":246},[14,370,371,372,374],{},"For example, to update user ID ",[38,373,323],{}," with a secure random password:",[197,376,378],{"className":199,"code":377,"language":201,"meta":202,"style":202},"wp user update 1 --user_pass=\"y8#K9$qP2!mZ\" --allow-root\n",[38,379,380],{"__ignoreMap":202},[206,381,382,384,386,388,391,394,397,400,403],{"class":208,"line":209},[206,383,247],{"class":246},[206,385,250],{"class":216},[206,387,355],{"class":216},[206,389,390],{"class":212}," 1",[206,392,393],{"class":212}," --user_pass=",[206,395,396],{"class":216},"\"y8#K9",[206,398,399],{"class":358},"$qP2",[206,401,402],{"class":216},"!mZ\"",[206,404,313],{"class":212},[78,406,408],{"id":407},"security-best-practice","🔒 Security Best Practice",[14,410,411,412,415],{},"Typing passwords directly in a shell command logs them into your system's shell history (",[38,413,414],{},"~\u002F.bash_history","). To prevent unauthorized users with server access from reading your new password, clear your shell history immediately after the command:",[197,417,419],{"className":199,"code":418,"language":201,"meta":202,"style":202},"history -c\n",[38,420,421],{"__ignoreMap":202},[206,422,423,426],{"class":208,"line":209},[206,424,425],{"class":212},"history",[206,427,428],{"class":212}," -c\n",[75,430],{},[189,432,434],{"id":433},"step-4-verify-the-changes","Step 4 — Verify the Changes",[14,436,437,438,63],{},"Once completed, open your web browser and navigate to your WordPress admin panel (e.g., ",[38,439,440],{},"https:\u002F\u002Fyoursite.com\u002Fwp-admin",[14,442,443],{},"Attempt to log in with your username and the newly configured password. If you can access the dashboard, the password has been successfully reset.",[445,446,447],"style",{},"html pre.shiki code .sj4cs, html code.shiki .sj4cs{--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .sZZnC, html code.shiki .sZZnC{--shiki-default:#032F62;--shiki-dark:#9ECBFF}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .sScJk, html code.shiki .sScJk{--shiki-default:#6F42C1;--shiki-dark:#B392F0}html pre.shiki code .sVt8B, html code.shiki .sVt8B{--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .szBVR, html code.shiki .szBVR{--shiki-default:#D73A49;--shiki-dark:#F97583}",{"title":202,"searchDepth":449,"depth":449,"links":450},2,[451,453,454,457,460],{"id":80,"depth":452,"text":81},3,{"id":191,"depth":449,"text":192},{"id":232,"depth":449,"text":233,"children":455},[456],{"id":256,"depth":452,"text":257},{"id":329,"depth":449,"text":330,"children":458},[459],{"id":407,"depth":452,"text":408},{"id":433,"depth":449,"text":434},[462],"technical",null,"2023-07-02","Reset a lost WordPress administrator password instantly from the terminal using WP-CLI. Learn how to list users and bypass root execution limits.",false,"md","\u002Fimages\u002Fhero\u002Fwp-cli.avif","en",{},true,"\u002Freset-wordpress-admin-password-using-wp-cli",{"title":6,"description":465},"reset-wordpress-admin-password-using-wp-cli",[476,477],"wordpress","wp-cli","2026-06-21","W3nPfK5AXiKzOly1L5aiTTLiwHKlg0xYt95LKx0X_Xg",{"path":481},"\u002Ftr\u002Fwordpress-yonetici-sifresini-wp-cli-kullanarak-sifirlama",{"prev":483,"next":486,"others":489,"lucky":594,"readingTime":452},{"path":484,"title":485},"\u002Ftroubleshooting-cyberpanel-inaccessibility-after-ubuntu-release-upgrade","Troubleshooting CyberPanel Inaccessibility After Ubuntu Release Upgrade",{"path":487,"title":488},"\u002Fgraphql-vs-rest-api-which-is-the-best-choice-for-headless-wordpress","GraphQL vs REST API: Which is the Best Choice for Headless WordPress?",[490,493,496,499,502,505,508,511,512,513,516,519,522,525,528,531,534,537,540,543,546,549,552,555,558,561,564,567,570,573,576,579,582,585,588,591],{"path":491,"title":492},"\u002Ffull-stack-project-development","Sample REST API Project",{"path":494,"title":495},"\u002Frest-api-authentication","How to Perform REST API Authentication?",{"path":497,"title":498},"\u002Frest-api-design","REST API Design: Principles and Output Format",{"path":500,"title":501},"\u002Frest-api-documentation-and-testing","How to Document and Test a REST API?",{"path":503,"title":504},"\u002Frest-api-error-handling","How to Perform REST API Error Handling?",{"path":506,"title":507},"\u002Frest-api-security","How to Secure a REST API?",{"path":509,"title":510},"\u002Frest-api-uri-structure","What Should the REST API URI Structure Be?",{"path":484,"title":485},{"path":487,"title":488},{"path":514,"title":515},"\u002Fgrow-your-business-in-turkey-with-expert-wordpress-plugin-and-theme-localization-and-support-services","Grow Your Business in Turkey with Expert WordPress Plugin and Theme Localization and Support Services",{"path":517,"title":518},"\u002Fgetting-started-with-devops-understanding-the-principles-and-adopting-the-tools","Getting Started with DevOps: Understanding the Principles and Adopting the Tools",{"path":520,"title":521},"\u002Fphp-graphql-development-advanced-techniques-for-optimizing-your-apis","PHP GraphQL Development: Advanced Techniques for Optimizing Your APIs",{"path":523,"title":524},"\u002Fadvanced-techniques-for-dependency-injection-in-php-tips-code-samples-and-faqs","Advanced Techniques for Dependency Injection in PHP: Tips, Code Samples, and FAQs",{"path":526,"title":527},"\u002Fmaximize-the-potential-of-headless-wordpress-with-graphql","Maximize the Potential of Headless WordPress with GraphQL",{"path":529,"title":530},"\u002Fwriting-clean-modular-and-reusable-code-in-php","Best Practices for Writing Clean, Modular, and Reusable Code in PHP",{"path":532,"title":533},"\u002Fheadless-cmss-an-overview-of-popular-alternatives-to-contentful-and-wordpress","Headless CMSs: An Overview of Popular Alternatives to Contentful and WordPress",{"path":535,"title":536},"\u002Fci-cd-for-php-a-comprehensive-guide","CI\u002FCD for PHP: A Comprehensive Guide",{"path":538,"title":539},"\u002Fintroduction-to-php-namespaces-a-beginners-guide-to-structuring-your-code","Introduction to PHP Namespaces: A Beginner's Guide to Structuring Your Code",{"path":541,"title":542},"\u002Fwhat-is-graylog-a-powerful-tool-for-collecting-indexing-and-analyzing-log-data","What is Graylog? A Powerful Tool for Collecting, Indexing, and Analyzing Log Data",{"path":544,"title":545},"\u002Felevate-your-turkish-audience-experience-with-professional-wordpress-plugin-and-theme-translation","Elevate Your Turkish Audience Experience with Professional WordPress Plugin and Theme Translation",{"path":547,"title":548},"\u002Fhow-to-set-up-a-self-hosted-api-gateway-a-comprehensive-guide","How to Set Up a Self-Hosted API Gateway: A Comprehensive Guide",{"path":550,"title":551},"\u002Fdifference-between-generators-and-iterators-in-php","The Key Differences Between PHP Generators and Iterators",{"path":553,"title":554},"\u002Fphp-and-machine-learning-a-winning-combination-with-php-ml","PHP and Machine Learning: A Winning Combination with PHP-ML",{"path":556,"title":557},"\u002Fphp-generators-a-beginners-guide-to-iteration","PHP Generators: A Beginner's Guide to Iteration",{"path":559,"title":560},"\u002Fmastering-closures-in-javascript-a-beginners-guide","Mastering Closures in JavaScript: A Beginner's Guide",{"path":562,"title":563},"\u002Fthe-top-php-certification-programs-for-developers","The Top PHP Certification Programs for Developers",{"path":565,"title":566},"\u002Fhow-to-revalidate-next-js-isr-cache-on-demand-cache-regeneration","How to Revalidate Next.js ISR Cache? On-Demand Cache Regeneration",{"path":568,"title":569},"\u002Ftips-for-translating-a-wordpress-plugin-wordpress-theme-to-turkish","Tips for Translating a WordPress Plugin \u002F WordPress Theme to Turkish",{"path":571,"title":572},"\u002Fall-about-headless-wordpress","All About Headless WordPress",{"path":574,"title":575},"\u002Finstall-composer-on-ubuntu","How to Install Composer on Ubuntu \u002F Linux",{"path":577,"title":578},"\u002Fwhat-is-an-api-gateway","What is an API Gateway? Should You Use It?",{"path":580,"title":581},"\u002Fis-jwt-safe-or-is-it-vulnerable","Is JWT Safe or Is It Vulnerable?",{"path":583,"title":584},"\u002Ftailwind-css-to-use-or-not-to-use-that-is-the-question","Tailwind CSS! To use? Or not to use? That is the question.",{"path":586,"title":587},"\u002Fwhat-is-hateoas","What is HATEOAS?",{"path":589,"title":590},"\u002Fhello-world","Hello World: A New Multilingual Journey",{"path":592,"title":593},"\u002Fwhat-is-ecmascript","What is ECMAScript? What is not?",{"path":577,"title":578},[596,598,600],{"path":526,"title":527,"date":597},"2023-01-17",{"path":532,"title":533,"date":599},"2023-01-16",{"path":571,"title":572,"date":601},"2022-05-17",[603,605,607],{"path":509,"title":510,"date":604},"2026-06-20",{"path":484,"title":485,"date":606},"2023-10-14",{"path":586,"title":587,"date":608},"2022-05-12",1782141979267]