Skip to content
Back to Blog
Security11 min read

Common WordPress Security Mistakes: 7 Steps That Work

Most WordPress sites fall victim to the same preventable security holes. Learn which mistakes actually matter and the exact steps to fix them before an attacker does.

Written by Abdul AbrorTechnical Hosting Support Engineer
Common WordPress Security Mistakes: 7 Steps That Work
On this page

You set up WordPress, installed a theme, and published your first post. The site works. But if you skipped the security steps, you left the front door wide open.

I've restored hundreds of hacked WordPress sites in support tickets. The pattern is always the same: admin username still set to "admin", file permissions at 777, no firewall, plugins three years out of date. Attackers scan for these mistakes automatically. They find them in minutes.

Here are the nine mistakes I see most often, and the steps that actually fix them.

Mistake 1: Using "admin" as the username

The default WordPress username used to be "admin." Older tutorials still recommend it. Brute-force bots try "admin" first because half the internet uses it.

Your login page gets hammered with thousands of attempts per day. If your password is weak and your username is "admin," you will get compromised. It's not a matter of if.

What to do instead:

Create a new administrator account with a unique username during installation. Not your domain name, not your business name, not "administrator." Pick something unguessable.

If you already have an "admin" account, log in to phpMyAdmin through cPanel, navigate to the wp_users table, and change the user_login value directly. Or create a new admin user through the WordPress dashboard, log out, log back in as the new user, and delete the old "admin" account.

Always assign posts and content to the new account before deletion. WordPress will prompt you.

Mistake 2: Weak or reused passwords

A twelve-character random password stops brute-force attacks cold. An eight-character dictionary word with a "1" at the end does not.

I've seen sites breached because the client used the same password for WordPress, cPanel, FTP, and their email. Once the attacker had one, they had everything.

What to do instead:

Generate a unique password for every service. Use a password manager. Minimum 16 characters, random mix of upper, lower, digits, and symbols.

In WordPress, go to Users → Profile and scroll to Account Management. Click "Generate Password." Use that. Store it in your password manager.

Do the same for your cPanel account, your database user, and your FTP accounts. Never reuse credentials across services.

If you manage client sites, enforce strong passwords through a security plugin that checks password strength on user creation.

Mistake 3: Skipping two-factor authentication

Passwords leak. Keyloggers exist. Phishing works. Two-factor authentication (2FA) adds a second proof of identity that an attacker can't steal remotely.

Without 2FA, a compromised password means a compromised site. With 2FA, the attacker also needs physical access to your phone or authentication device. That's a much higher bar.

What to do instead:

Install a 2FA plugin. I recommend WP 2FA or Wordfence (which includes 2FA in the free version). Both support authenticator apps like Google Authenticator, Authy, or 1Password.

Enable 2FA for all administrator and editor accounts. Contributors and subscribers are lower risk, but if your content is sensitive, enable it for them too.

Store backup codes in your password manager. If you lose your phone, you need a way back in that doesn't involve reinstalling WordPress.

Mistake 4: Leaving file permissions wide open

File permissions control who can read, write, and execute files on your server. Permissions set to 777 mean anyone—including the web server running as a different user—can modify your core WordPress files.

Attackers upload a shell script, modify wp-config.php, or inject code into a plugin file. All because the permissions allowed it.

What to do instead:

Log in via SSH or use the cPanel File Manager. Set directories to 755 and files to 644.

find /home/username/public_html -type d -exec chmod 755 {} \;
find /home/username/public_html -type f -exec chmod 644 {} \;

Your wp-config.php file contains database credentials. Lock it down to 640 or 600:

chmod 600 /home/username/public_html/wp-config.php

If WordPress complains it can't write to wp-content/uploads, set that directory to 755. The web server needs write access there. Everywhere else, keep it restrictive.

Never set permissions to 777 on a production site. If a plugin demands it, find a better plugin.

Mistake 5: Ignoring plugin and theme updates

Every week, security researchers publish new vulnerabilities in WordPress plugins. Actively exploited ones get added to botnets within days. If you're running an outdated plugin with a known flaw, automated scanners will find you.

I've seen sites compromised through three-year-old contact form plugins, outdated sliders, and abandoned SEO tools. The fix was always available. The site owner just never applied it.

What to do instead:

Log in to your WordPress dashboard weekly and check for updates. Core, plugins, themes—update all of them.

Before updating, take a backup. Use a plugin like UpdraftPlus or your hosting provider's backup tool. If an update breaks the site, you can roll back.

Test updates on a staging site first if you run a business-critical site. Most managed WordPress hosts and some cPanel setups offer one-click staging.

Delete plugins and themes you're not using. Inactive code still gets scanned by attackers. If it has a vulnerability, you're at risk even if it's disabled.

Set up email notifications for available updates. WordPress core can email you; most security plugins can too.

Mistake 6: No firewall or security plugin

WordPress has no built-in firewall. Out of the box, it accepts every HTTP request and processes it. Brute-force bots, SQL injection attempts, file inclusion attacks—WordPress tries to handle them all until something breaks.

A web application firewall (WAF) sits in front of WordPress and blocks malicious requests before they reach your PHP code.

What to do instead:

Install Wordfence, Sucuri Security, or iThemes Security. All three include a firewall, malware scanner, and brute-force protection.

Wordfence runs on your server. Sucuri offers a cloud-based WAF (paid). iThemes is lighter weight. Pick one and configure it.

At minimum, enable these features:

  • Brute-force protection: Rate-limit login attempts and block IPs after repeated failures.
  • Malware scanning: Schedule weekly scans of your core files, plugins, and themes.
  • Firewall rules: Block known attack patterns (SQL injection, XSS, file inclusion).

If your host offers ModSecurity, enable it. It's an Apache/Nginx module that filters requests before they reach PHP. Combined with a WordPress security plugin, it's a strong second layer.

Cloudflare's free plan includes basic WAF rules. Point your domain through Cloudflare and enable "Under Attack Mode" if you're actively being hit.

Mistake 7: Exposing wp-config.php and other sensitive files

Your wp-config.php file contains your database username, password, hostname, and authentication salts. If an attacker can read it, they can dump your entire database, create new admin accounts, or pivot to other sites on the same server.

Some server misconfigurations let attackers request wp-config.php directly. Others expose .git directories, backup files (wp-config.php.bak), or SQL dumps.

What to do instead:

Add rules to your .htaccess file to block direct access:

<Files wp-config.php>
  Require all denied
</Files>

<FilesMatch "^(wp-config\.php|\.htaccess|readme\.html|license\.txt)$">
  Require all denied
</FilesMatch>

Move wp-config.php one directory above your WordPress root if your hosting setup allows it. WordPress will still find it, but web requests won't.

Delete readme.html, license.txt, and the wp-admin/install.php file after installation. They reveal your WordPress version to attackers.

Block access to .git, .svn, and backup files:

RedirectMatch 403 /\.git
RedirectMatch 403 /\.svn
RedirectMatch 403 \.sql$
RedirectMatch 403 \.bak$

Scan your web root for files ending in .bak, .sql, .old, or .zip. Delete them or move them outside the web-accessible directory.

Mistake 8: Leaving XML-RPC enabled with no protection

XML-RPC is a WordPress API that lets external applications publish posts, manage comments, and perform other tasks. It's also a favorite target for brute-force attacks and DDoS amplification.

Attackers use the system.multicall method to try hundreds of username/password combinations in a single HTTP request. Your server logs one request; your site processes a thousand login attempts.

What to do instead:

If you don't use Jetpack, the WordPress mobile app, or third-party publishing tools, disable XML-RPC entirely.

Add this to your .htaccess:

<Files xmlrpc.php>
  Require all denied
</Files>

Or install a security plugin that includes an XML-RPC toggle. Wordfence and iThemes both have one.

If you need XML-RPC for Jetpack, use Jetpack's Protect module to block brute-force attempts, or configure your firewall to rate-limit requests to xmlrpc.php.

Monitor your server logs for repeated POST requests to /xmlrpc.php. If you see thousands per hour, you're under attack.

Mistake 9: No backups or disaster recovery plan

Even with every precaution, sites get hacked. Plugins have zero-day flaws. Servers get compromised. Hard drives fail. If you don't have a recent backup, you start from scratch.

I've talked clients through restoring from backups they took three days before an attack. I've also told clients we can't restore because their last backup was eight months old and corrupted.

What to do instead:

Take automated daily backups. Store them off-server—different physical location, different provider.

Use a plugin like UpdraftPlus, BackWPup, or your host's built-in backup tool. Configure it to back up files and database every night and send copies to Google Drive, Dropbox, or Amazon S3.

Test your backups monthly. Download one and restore it to a staging site or local environment. A backup you haven't tested is no backup at all.

Keep at least 30 days of backup history. If malware sits dormant for two weeks, your most recent backup might already be infected. You need a clean restore point.

Document your restore process. Write down where backups are stored, how to download them, and the exact steps to restore. When your site is down and you're stressed, you don't want to figure it out from scratch.

What about HTTPS and SSL certificates?

HTTPS encrypts traffic between your visitors and your server. Without it, login credentials and session cookies travel in plain text. An attacker on the same Wi-Fi network can intercept them.

Most hosts offer free Let's Encrypt certificates through cPanel. Install one, then force HTTPS by adding this to your .htaccess:

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

Update your WordPress site URL and home URL in Settings → General to use https://. Mixed content warnings break functionality and scare visitors.

FAQ

Do I need a paid security plugin?

The free versions of Wordfence and iThemes Security cover the basics: firewall, brute-force protection, malware scanning. Paid versions add real-time threat intelligence, country blocking, and scheduled scans. For most small sites, free is enough.

How often should I update WordPress?

Check weekly. Apply security updates immediately. Minor and major updates can wait a day or two if you want to let others test them first, but don't delay longer than that.

Can I stop all attacks with a plugin?

No. Security plugins add layers of defense, but they're not a silver bullet. You still need strong passwords, proper file permissions, regular updates, and backups. Think of them as one part of a larger strategy.

What if my site is already hacked?

Take it offline, restore from a clean backup, change all passwords (WordPress, database, FTP, cPanel), update everything, scan for malware, and review your logs to find the entry point. If you're not comfortable doing this yourself, hire someone.

Should I hide my WordPress version?

Removing version numbers from your source code makes reconnaissance slightly harder, but attackers probe for vulnerabilities directly. Keeping WordPress updated is far more important than hiding the version.

The checklist that actually works

You don't need to understand exploit chains or read CVE databases. You need to do the boring work that stops 95% of attacks.

Change the default username. Use strong unique passwords. Enable two-factor authentication. Set correct file permissions. Update everything weekly. Install a security plugin. Block access to sensitive files. Disable or protect XML-RPC. Take daily backups and test them.

None of this is optional. Every site that skips these steps eventually ends up in a support ticket with me, and by then the damage is done.