忘記Password怎辦? 透過 FTP 重置 WordPress Password - Felix Fan

忘記Password怎辦? 透過 FTP 重置 WordPress Password

從1-Minute Guy 學到一個字「Assign」
October 30, 2020

忘記Password怎辦? 透過 FTP 重置 WordPress Password

你有試過只記得WordPress 帳號,卻忘記WordPress密碼,又忘記登記電郵嗎?如果你也遇上相同問題,以下這篇筆記就適合你了:

筆記 1:

What to Do If You Need to Reset Your WordPress Admin Password via FTP

Do not despair if you have lost your WordPress password. YOu can quite easily reset your WordPress admin password using FTP.

This option is mostly useful if you have tried to reset it normally but were unable to.

What’s the problem?

You have lost your WordPress Admin Password and are using WordPress through FTP. You have tried to reset the password using the forgot password link but didn’t get the reset email.

Steps to reset your WordPress admin password using FTP

Step 1

Login to your FTP account

Step 2

Go to “xx/wp-content/themes/[whichever is your active theme]”

Step 3

Download the functions.php file

Step 4

Delete the pre-entered text YourNewPassword with the actual 

new password

that you want to use. Note that the number “1” within the script is your user ID number in the wp_users table

Step 5

Upload the edited functions.php file to your FTP account.

Step 6

Log into WordPress with your new username

這時按Log In之後,會顯示甚麼”cookie xyz…”,這其實代表已經改密碼成功,你只需要Refresh頁面就成功進入了。

Step 7

Remove the code from your edited functions.php file and complete the process by uploading it to your FTP.

And that’s how to reset your WordPress admin password using FTP.

筆記 2:

如你用ServerPilot,登入 FTP的資料為:

1. Hosting Server , e.g. 168.123.112.132

2. User Name , e.g. 在ServerPilot 的System User有顯示

3. Port : ftp:// 為 21 ; sftp:// 為 22.

筆記 3:

在 functions.php 檔案內,<?php 之後加句 wp_set_password( ‘password‘,hkcpoa);

password 為新密碼、hkcpoa為Username。

筆記 4:

筆者試過在填了 <?php 之後加句 wp_set_password( ‘password‘,hkcpoa); 後無法登入到 xyz (你的網址).com/wp-admin,筆者的解決方法是,在填以上code前先在瀏覽器開啟xyz(你的網址).com/wp-admin,然後當ftp更新後便refresh此頁。

筆記 5:

如果你連username都忘記了,試試在WordPress ( xyz(你的網址).com/wp-admin) 的 Forget Password頁,撞撞自己的username,如果這樣的撞不了,你可能就要用 PhpMyAdmin來處理了!

---

當跟著筆記1的方法行一趟,便能夠重新登入帳號了!

Comments are closed.