[WordPress] Authentication codes are no longer being sent in a WordPress environment with 2FA authentication added.

I had set up 2FA login when logging into WordPress to enhance security.
I had been able to log in until two or three days ago, but suddenly I stopped receiving authentication codes.

I couldn’t log into the administration screen, so I decided to investigate.

目次

Possibility that emails are no longer being sent with the WP Mail SMTP plugin

I had defined email sending using WP Mail SMTP.

This plugin was set to auto-update, so I investigated whether it had been updated recently.

Looking at the changelog, I saw that there was an update on 2025-06-05 to end support for PHP 7.2. I thought, ‘Could this be it?’, but since it was running on PHP 8.2, it didn’t seem to be related.

Investigate using SSH

Check the WordPress error log.

Investigate WordPress’s error_log. In a bitnami environment, it is logged below.
At first glance, there didn’t seem to be any output.

tail -f /opt/bitnami/apache2/logs/error_log

Disable the plugin that is performing 2FA and log in to the administration screen.

Move to the plugins directory and disable the plugin with 2FA settings.

Simply rename the file.

I was able to log in to the administration screen with 2FA turned off.

Once you have logged in to the administration screen, check the email log using the WP Mail SMTP plugin.

There was a SendGrid sending limit error. Come to think of it, I think I was using the free version.

Upon investigation, we discovered that SendGrid could be used with restrictions even with the free plan, but after the free trial period (60 days) expired, it would be suspended.

This is a difficult situation, as there are many cases like this when relying on external services.

Therefore, we discontinued SendGrid and switched to the Gmail API. (Free limit: approximately 500 emails sent per 24 hours)

Summary

This method uses SSH, so if you cannot use SSH, you will need to take appropriate backups and then restore them.

However, it is better to be able to log in via SSH.

シェア!

この記事を書いた人

kenichiのアバター kenichi エンジニア・写真家 | Engineer and photographer

Nomadic worker who travels all over Japan and abroad; worked as a technical sales person for five years before going independent.
Works as a freelance engineer on website production and application development. Currently working to bring interesting things by interesting people to the world, while seeking to move abroad.

目次