Most attacks on WordPress sites are automated. Programs scan the web all day looking for old software, weak passwords and open doors. A small business site gets scanned just like a large one.
The common gaps are well known, and most of them take only minutes to close. Below are eleven fixes, with the reason for each and the steps to do it. You can do most of them yourself from the WordPress dashboard.
Start with the software: update it and clean it up
1. Update WordPress, plugins and themes
Updates often close security holes that are already public knowledge. Once a hole is announced, attackers start scanning for sites that still run the old version. An out-of-date plugin is one of the most common ways into a WordPress site.
Log in, open Dashboard > Updates and install everything listed there. Take a backup first. On a busy site, update plugins one at a time, so you can see which one caused the problem if something breaks. On the Plugins screen you can also click Enable auto-updates beside the plugins you trust. Then ask your host which PHP version your site runs on, and move to a supported version if it is old.
2. Remove plugins and themes you do not use
A deactivated plugin still sits on your server, and its files can still be attacked. Every extra plugin is also more code that someone has to keep updated.
Go to Plugins > Installed Plugins and delete everything inactive that you do not need. Under Appearance > Themes, keep your active theme and one default WordPress theme as a fallback, and delete the rest. Replace any plugin whose author has stopped releasing updates. Never install pirated copies of paid themes or plugins, because they often carry hidden malicious code.
Lock the login page and control who gets in
3. Use strong passwords and two-factor login
Attackers try long lists of leaked and common passwords against WordPress login pages. A short or reused password will fall to that sooner or later. Two-factor login adds a second step, usually a code from an app on your phone, so a stolen password alone will not open the door.
Give every user a long, unique password and store it in a password manager. WordPress can generate one for you under Users > Profile. Avoid the username admin, since it is the first one attackers try. WordPress does not include two-factor login by default, so add it with a well-reviewed security plugin or through your host, and require it for every administrator.
4. Limit login attempts
By default, WordPress lets anyone guess passwords as many times as they like. That makes automated guessing cheap for the attacker.
Set a limit, so that an address is blocked for a while after a handful of failed logins. Many security plugins and some hosts include this setting.
5. Give each user the lowest role that works
Every administrator account is a full set of keys to your site. If a writer's account with administrator rights is taken over, the attacker can install plugins, add users and change anything.
Open Users > All Users and review the list. WordPress has five standard roles: Administrator, Editor, Author, Contributor and Subscriber. People who only write posts should be Authors or Contributors, and people who manage content should be Editors. Keep administrator accounts for the few people who truly need them, and delete the accounts of former staff and past contractors.
Protect your data with tested backups and HTTPS
6. Keep backups you have tested
A backup is your way back after a hack, a bad update or a mistake. An untested backup is only a hope.
Back up both the files and the database, on a schedule that matches how often your site changes. A shop with daily orders needs more frequent backups than a brochure site. Store copies somewhere other than the web server, because a backup on the same server can be lost or infected along with the site. Then test it. Restore a backup to a staging copy of the site, which is a private duplicate used for testing, and check that pages, images and forms work.
7. Use HTTPS on every page
HTTPS encrypts what travels between your visitor's browser and your site, including passwords and form entries. Without it, browsers warn visitors that your site is not secure, and logins can be read on shared networks.
Ask your host to install an SSL certificate, which most hosts can do from the control panel. Then go to Settings > General and make sure both site addresses begin with https. Set the old http addresses to redirect to the secure ones. Finally, click through your main pages and confirm the browser shows no warnings.
Harden the server side of your site
8. Add a firewall or security plugin
A web application firewall filters visitors before they reach WordPress and blocks requests that match known attack patterns. A security plugin usually adds malware scanning, login protection and alerts in one place.
Choose one established security plugin or firewall service and set it up fully. Running several security plugins together often causes conflicts and slows the site. After setup, run a full scan and work through whatever it reports.
9. Choose safe hosting
Your host controls the server your site lives on. On poorly run shared hosting, a hacked neighbor site or outdated server software can put your site at risk even if you do everything else right.
Ask your host these questions:
- Is my site isolated from other customers' sites on the same server?
- Do you keep the server software and PHP up to date?
- Do you take automatic backups, and how do I restore one?
- Do you scan for malware and tell me if you find it?
- Can I get a staging copy of my site for testing updates?
If the answers are vague, plan a move to a host that can answer them clearly.
10. Fix file permissions and turn off file editing
File permissions decide who may read or change each file on the server. Permissions that are too open let an attacker with a small foothold rewrite your site's files. WordPress also has a built-in editor that lets any administrator change theme and plugin code from the dashboard. An intruder with a stolen login can use it to plant malicious code.
Ask your host or developer to confirm that no file or folder is writable by everyone. Ask them to check that wp-config.php, the file holding your database password, can be read only by the site's own account. If a tutorial tells you to open a folder to full access to make an error go away, do not do it. To turn off the built-in editor, have your developer add this line to wp-config.php: define( 'DISALLOW_FILE_EDIT', true );
Watch the site so you catch problems early
11. Set up monitoring
Many hacks stay quiet for a long time. The attacker adds hidden spam pages or redirects visitors who arrive from search, and the owner sees nothing unusual. The sooner you notice, the smaller the cleanup.
Set up these checks:
- An uptime monitor that emails you when the site goes down.
- A scheduled malware and file-change scan from your security plugin or host.
- Google Search Console, which reports security issues Google finds on your site.
- An activity log that records logins, new users and plugin changes.
- A regular look at the Users list for accounts you do not recognize.
Decide who receives these alerts and what they do next. An alert that goes to an unread inbox protects nothing.
Where each fix happens and how often to repeat it
Security is routine work. This table shows where each fix is done and when to come back to it.
| Fix | Where you do it | How often |
|---|---|---|
| Updates | WordPress dashboard | Weekly |
| Remove unused plugins and themes | WordPress dashboard | Every few months |
| Passwords and two-factor login | User profiles and security plugin | Once, then for each new user |
| Login attempt limit | Security plugin or host | Once |
| User roles | Users screen | Whenever staff change |
| Backups and restore test | Backup tool or host | Backups on a schedule, restore tests a few times a year |
| HTTPS | Host control panel and Settings | Once, then check that the certificate renews |
| Firewall or security plugin | Plugin or firewall service | Once, then read the reports |
| Hosting | Your hosting company | Review yearly |
| File permissions and file editing | Server and wp-config.php | Once, and after any site move |
| Monitoring | Monitoring tools and Search Console | Always on |
If you can only do three things this week, update everything, turn on two-factor login for administrators and test a backup.
How Growthworx can secure your WordPress site
Growthworx is a digital agency working since December 2015, with 1,000+ clients served and 3,000+ projects completed. WordPress is one of our main services, and the eleven fixes above are the ones we would work through on any WordPress site.
If you would like a second pair of eyes, ask for our free website review. We will look at your site and tell you which of these gaps we see. Our WordPress development service starts at $1,499 for the Business package, with Professional and Enterprise packages for larger sites.
To take the next step, read more about WordPress development at Growthworx, or request a free quote and tell us about your site.
