Secure WordPress
Published
Updated
Keep WordPress on fortrabbit secure with automatic updates for core, plugins and themes, blocked login and XML-RPC endpoints, SMTP for e-mail, and WP-CLI for password resets.
WordPress installs minor core releases automatically. Turn on automatic updates for plugins and themes in wp-admin too, see automatic background updates and update WordPress.
Protect against bots
Bots attack wp-login.php and xmlrpc.php all day. Block XML-RPC when no app uses it, and limit the login, for example with .htaccess rules or the incoming firewall.
Sending e-mails
fortrabbit has no sendmail, so wp_mail() needs an SMTP plugin such as WP Mail SMTP or WP SMTP, with a mail account or a transactional mail provider.
Resetting the wp-admin password
Without working e-mail, "Lost your password?" does not work. Reset the password another way.
The recommended method is WP-CLI over an SSH connection. It hashes the new password with the current WordPress algorithm:
wp user update admin --user_pass="a-strong-new-password"
Replace admin with the account's user login or email address.
As a fallback, set the password directly in the database. WordPress accepts an MD5 hash in the user_pass column for backward compatibility and re-hashes it with the current algorithm on the next successful login:
- Connect to the remote MySQL database from local
- Find the account in the
wp_userstable - Set
user_passto the MD5 hash of a safe new password - Log in to wp-admin, which upgrades the stored hash automatically