WordPress is the most popular website software, so it is also the most attacked. Most hacked sites
were running old software, a weak password, or a plugin or theme from an untrustworthy source. A few
habits prevent most problems.
Keep everything up to date
- Update WordPress, plugins and themes as soon as updates are available: see
Updating WordPress, plugins and themes. Turn on Smart Update and automatic updates in
WordPress Management if you can.
- Delete plugins and themes you do not use. Deactivated ones can still be attacked.
Use WP Toolkit's security measures
In cPanel, open WordPress Management and click Security to see the measures for your sites,
or click the security message on a site's card, then Secure or Apply All. You can undo them
with Revert. Check WordPress Integrity compares WordPress's own files with the originals. See
WordPress Management (WP Toolkit).
Strong, separate logins
- Use a long, unique password for WordPress, cPanel, FTP and the database. Do not reuse them.
- Delete users you do not recognise and give people only the role they need.
- Use two-factor authentication on WordPress with a plugin that supports it.
- Do not use the username
admin.
Install carefully
- Get plugins and themes only from WordPress.org or the author's own site.
- Never use "nulled" themes or plugins (pirated copies of paid ones). They very often contain
hidden malware.
Have a way back
Keep backups, and test that you can restore one: see What backups are included.
If it has already happened
See My website has been hacked: what to do. You can also open a support ticket.