How do I secure a WordPress site?

Updated 5 min readBy the MoneroWebHosting team

On this page
  1. How do most WordPress sites get hacked?
  2. Which wp-config.php settings harden WordPress?
  3. Do you need a WordPress security plugin?
  4. Which logins around WordPress also need protecting?
  5. What should you do if WordPress is already hacked?
  6. Which threat does each security measure stop?
  7. How to secure a WordPress site, step by step?
  8. Questions about securing WordPress

Quick answer

Securing a WordPress site comes down to six habits: prompt updates, unique passwords with two-factor login, few plugins, locked-down files, HTTPS and tested backups. MoneroWebHosting supplies free SSL, SFTP with SSH keys and daily backups on plans from $3.69 a month paid in Monero; the 9 steps below handle the rest.

In brief
  • Outdated plugins and reused passwords cause most WordPress break-ins.
  • One line in wp-config.php disables the dashboard’s code editor.
  • Two-factor login on every administrator account blocks stolen-password attacks.
  • The logins around WordPress, panel, SFTP and mailboxes, need the same care.

How do most WordPress sites get hacked?

Through known holes in outdated plugins and themes, and through passwords that leaked elsewhere. WordPress core updates itself for security releases by default; the risk sits in the extensions around it, especially abandoned ones and “nulled” copies of paid themes, which often arrive with a backdoor already inside.

The second door is the login. Automated scripts try lists of email and password pairs stolen from other services, so a password reused anywhere is effectively public. Neither attack targets a site personally; they sweep the whole web looking for whatever answers. Closing both doors removes most of the risk in an afternoon.

Which wp-config.php settings harden WordPress?

Start with define( 'DISALLOW_FILE_EDIT', true );, which removes the theme and plugin editors from the dashboard. A stolen administrator session then cannot paste code into a PHP file with two clicks. It does not stop uploads, so it complements updates rather than replacing them.

Two more points belong in the same file. Keep the authentication keys and salts unique; generating fresh ones logs everybody out, which is useful after an incident. Then restrict the file itself: the handbook suggests permissions of 440 or 400 for wp-config.php, 644 for other files and 755 for folders, adjusted if the host’s setup needs group read access.

Do you need a WordPress security plugin?

One well-maintained plugin for two-factor login is the most useful addition; a pile of overlapping firewalls is not. A second login factor from an authenticator app turns a stolen password into a dead key, for a few seconds of extra typing per sign-in.

Login rate limiting and file-change alerts add value too, but each plugin is also code that needs updates. Pick one that covers the needs, keep it current, and skip the rest. Speed matters as well: every extra plugin weighs on page loads, a point developed in how to speed up WordPress on shared hosting.

Which logins around WordPress also need protecting?

The control panel, SFTP, every mailbox and the hosting account itself. Any one of them reaches the site’s files without touching the WordPress login.

  1. Change the control panel password at first sign-in, as the dashboard prompts.
  2. Give an SSH public key for SFTP and SSH instead of relying on the password.
  3. Give each mailbox its own password; a compromised inbox can reset WordPress passwords.
  4. Keep the 16-digit MoneroWebHosting account number offline and protect it with a password: it opens the balance and every hosting account.

MoneroWebHosting checked 7 Monero-accepting hosts with a comparable 10-site plan on 30 November 2026; they averaged $13.72 a month. On a Studio account holding ten sites, one weak login exposes all ten, so this list matters more as sites accumulate.

What should you do if WordPress is already hacked?

Restore a clean backup from before the infection, then change every secret. Cleaning files by hand misses hidden backdoors more often than not. The daily backups on WordPress hosting paid with Monero reach back 7, 14 or 30 days by plan, and an off-site set from how to back up a WordPress site can reach further.

After restoring: update everything, replace the salts, reset all administrator, panel, SFTP and database passwords, and remove the plugin or theme that let the attacker in. Malware left running leads to suspension under the acceptable use policy, so act quickly and tell support what happened.

Which threat does each security measure stop?

WordPress security measures mapped to threats, from the WordPress hardening guide, compiled by MoneroWebHosting, 30 November 2026
MeasureMain threat stoppedSet in
Prompt updatesKnown plugin and theme flawsWordPress dashboard
Two-factor loginStolen or reused passwordsPlugin, per user
DISALLOW_FILE_EDITCode injection through the editorwp-config.php
SFTP with an SSH keyPassword sniffing and guessingCheckout or control panel
Free SSL (HTTPS)Session theft on open networksAutomatic on MoneroWebHosting
Daily and off-site backupsPermanent loss after an attackHost plus owner’s copies

How to secure a WordPress site, step by step?

  1. Update core, plugins and themes

    Install pending updates under Dashboard › Updates and turn on automatic updates for plugins that support it.

  2. Remove what is not used

    Delete deactivated plugins and spare themes; inactive code can still be reached and exploited.

  3. Enforce strong passwords and 2FA

    Give every administrator a long unique password and an authenticator-app second factor.

  4. Retire the “admin” user name

    Create a new administrator with a less obvious name, sign in with it, and delete the old account, attributing its posts to the new one.

  5. Disable the file editor

    Add define( 'DISALLOW_FILE_EDIT', true ); to wp-config.php above the line that ends custom settings.

  6. Tighten file permissions

    Set folders to 755, files to 644 and wp-config.php to 440 or 400, over SFTP or SSH.

  7. Secure the hosting logins

    Change the control panel password, add an SSH key for SFTP and give each mailbox its own password.

  8. Serve everything over HTTPS

    Once the free certificate is active, set both addresses under Settings › General to https://.

  9. Keep tested backups

    Rely on the daily host backups, add an off-site set weekly, and test a restore now and then.

Questions about securing WordPress

Does MoneroWebHosting scan my WordPress site for malware?

The service includes free SSL, daily backups and SFTP with SSH keys; securing the WordPress install itself remains the owner’s job, using the steps on this page.

Should I change the wp_ table prefix?

On a new install it costs nothing and blocks some automated attacks. On an existing site, the gain is small and the change risky; focus on updates and passwords instead.

Is hiding the login page worth it?

It reduces log noise from bots but does not stop a targeted attacker. Two-factor login protects far more.

How often should WordPress be updated?

Security releases as soon as they appear, other updates within a week. Take a database export before major version jumps.

Verdict
  • Updates, 2FA and fewer plugins stop most WordPress attacks before any security plugin is needed.
  • Protect the panel, SFTP and mail logins as carefully as wp-admin.
  • MoneroWebHosting provides the HTTPS, SSH keys and daily backups; the habits are yours.
Sources (2)
  1. Hardening WordPress — WordPress.org Advanced Administration Handbook (checked 30 Nov 2026)
  2. Editing wp-config.php — WordPress.org Advanced Administration Handbook (checked 30 Nov 2026)

A safer WordPress start on Solo

1 website on 20 GB of NVMe, traffic not metered, 10 mailboxes, 10 MySQL databases, SSL certificates included and a nightly backup kept 7 days. SSH keys at checkout, paid in Monero.

$2.69 / month

Order Solo

Studio, from
$4.08 / month

Order hosting