没有不值得去解决的问题,也没有不值得去学习的技术!

Not Receiving a WordPress Admin Email Confirmation? Solve It Directly Through the Database

当我们在后台“设置 -> 常规”中修改管理员邮箱并保存后,页面顶部会出现一个横幅提示:“您即将修改管理员邮箱地址为 xxx@xxx.com。取消”。此时新邮箱并未生效,如果你一直收不到确认邮件,就会一直卡在这个状态。

作者:

在

When maintaining a WordPress site, we often need to change the “Administration Email Address” in the backend. For security reasons, WordPress sends a confirmation email to the new address whenever you modify the email. The new email only takes effect after you click the confirmation link.

However, many site owners encounter a frustrating problem: the confirmation email is never received! Whether the email fails to send because the server is not configured with SMTP, or it gets blocked by the email system, the result is that the email address cannot be changed. This article will share how to bypass this limitation by directly modifying the database.

1. WordPress Backend Stuck in Confirmation State

After we change the administrator email in “Settings -> General” in the backend and save, a banner prompt appears at the top of the page: “You are about to change the administration email address to xxx@xxx.com. Cancel”. At this point, the new email has not taken effect. If you never receive the confirmation email, you will remain stuck in this state.

After we change the administrator email in "Settings -> General" in the backend and save, a banner prompt appears at the top of the page: "You are about to change the administration email address to xxx@xxx.com. Cancel". At this point, the new email has not taken effect. If you never receive the confirmation email, you will remain stuck in this state.

2. Locating the Email Record in the Database

Since we cannot confirm it from the frontend, we will modify it directly at the database level. Log in to your database management tool (such as phpMyAdmin, Navicat, etc.) and locate the database corresponding to your website.

We can precisely query the record that currently stores the administrator email by executing the following SQL statement:

SQL
SELECT * FROM `wp_options` WHERE `option_name` = 'admin_email' LIMIT 20;

After execution, you can clearly see that the option_value field still contains the old email address.

After execution, you can clearly see that the option_value field still contains the old email address.

3. Executing SQL to Force Update the Email

Once the record is found, we only need to execute a simple UPDATE statement to force the email to be changed to the new address we need:

SQL
UPDATE wp_options SET option_value = 'shuijingwanwq@163.com' WHERE option_name = 'admin_email';

4. Modification Successful, Backend Restored to Normal

After executing the SQL statement, refresh the WordPress “General Settings” page. You will be pleasantly surprised to find that the administrator email has been successfully updated to the new one, and the previous annoying confirmation prompt stating “You are about to change the administration email address” has disappeared. The problem is perfectly solved!

After executing the SQL statement, refresh the WordPress "General Settings" page. You will be pleasantly surprised to find that the administrator email has been successfully updated to the new one, and the previous annoying confirmation prompt stating "You are about to change the administration email address" has disappeared. The problem is perfectly solved!

Summary

When WordPress fails to confirm the administrator email due to server email functionality defects, directly modifying the wp_options field value in the admin_email table is the fastest and most effective solution. If you encounter the same problem, give this method a try!

关于作者 · 持续学习与技术实践

我是一名拥有 15 年以上开发经验的技术从业者,自 2013 年起持续运营个人技术博客,记录工作与个人项目中遇到的真实问题,以及解决问题过程中的探索、实践和思考。

除了技术写作,我也在持续开发和维护自己的独立项目,探索新技术和新工具在实际场景中的应用。我始终相信,没有不值得去解决的问题,也没有不值得去学习的技术。

如果这篇文章对你有所帮助,欢迎浏览博客中的其他文章,也欢迎交流技术经验与想法。

关于我  ·  GitHub  ·  邮件联系