عربي
News
●E-invoicing: the last date to connect for wave 25 is February 1, 2027●WhatsApp Business: service messages are paid after 1,000 free per month●Salla acquires Paylink to strengthen payment solutions for merchants●Google launches a Gemini agent for businesses first, then consumers●Hostinger's White Friday deals continue until December 14

Strengthen your WordPress admin with two-step login and basic hardening

You will turn on two-step login for your WordPress admins with the Two Factor plugin, and apply the basic hardening steps from the WordPress docs: updates, plugins and disabling the file editor.

The problem

The wp-admin panel of a WordPress site is a constant target for attackers. They try the username admin and leaked passwords, and exploit outdated plugins. If someone gets in, they may place ads or malware on your site, steal customer data, or delete the site.

The tool

The reference is the “WordPress Hardening” page in the official developer docs at developer.wordpress.org, and the free Two Factor plugin from the WordPress.org repository. According to the plugin page, it adds a second step at login, and supports an authenticator app (TOTP), backup codes and codes sent by email. The page recommends the authenticator app and enabling backup codes.

The steps

  1. Take a full backup of the site and database before any change. The docs recommend regular backups that include the database, and testing the restore.
  2. Update WordPress, themes and plugins to the latest version, and turn on automatic updates where it suits you. The docs recommend running the latest release and downloading WordPress only from wordpress.org.
  3. Delete plugins and themes you don't use, and install only from the WordPress.org repository or well-known vendors. The docs advise reviewing the code of any plugin that asks for write access to files.
  4. Check the username and password: the docs advise against obvious usernames such as admin or webmaster. For an existing account they suggest renaming it in the user_login column of the wp_users table through phpMyAdmin, which needs a backup and care. And don't base the password on your name, company or site name. Use a password generator and a password manager.
  5. Install the Two Factor plugin from Plugins then Add New, and activate it.
  6. Open Users then Your Profile and scroll to the Two-Factor Options section. Enable one or more methods and set up each one. Choose the authenticator app (TOTP) and turn on Backup codes.
  7. Choose the primary method and click Update Profile.
  8. Repeat for every user with an Administrator or Editor role. An admin can edit other users' settings from their profiles. The plugin has no built-in way to require two-step for everyone, so follow up yourself.
  9. Disable the dashboard file editor by adding the line define( 'DISALLOW_FILE_EDIT', true ); to wp-config.php, so anyone who gets into your dashboard can't edit theme and plugin code from the browser.
  10. Use SFTP instead of FTP when uploading files, and use HTTPS for the admin area. The docs also mention a firewall plugin such as Wordfence or iThemes Security, or a server WAF, as an option.

The real cost

There is no cost. The Two Factor plugin is free and open source according to the WordPress.org repository, and no price is listed for it. If you want a paid firewall plugin, check its price on its developer's official page; we did not open it here.

The free alternative

If your site is on a hosted store such as Salla or Zid rather than WordPress, these steps don't apply, and you need the security settings of your own platform. We did not research their docs here.

Notes

  • We have not tried these steps ourselves yet; they are based on the current official docs. Button names may change, so if your interface differs, follow the docs.
  • According to the plugin page, a user can remove two-step login from their own account, so review user accounts from time to time. And someone who loses all their methods needs backup codes or an admin to reset their account.
  • According to its page, the plugin requires a recent WordPress and PHP 7.4 or later, so check compatibility with your site before installing.
  • Any change to wp-config.php or .htaccess can break the site if done wrong. Keep a copy of the file before editing.
  • We did not explain file permissions or database restrictions here; they are on the official hardening page, and restricting database privileges can break updates.
  • Don't keep passwords in a file on the server.

Sources

  1. developer.wordpress.org
  2. wordpress.org

Did you like this guide?

The weekly newsletter is being prepared. Leave your email and we'll send it when it launches.

We use your email only to send the newsletter. Privacy policy