Very few sites are broken into by a person sitting at a keyboard. Bots try leaked passwords on login pages and probe for plugins with known flaws, across thousands of sites every hour. Protection is therefore mostly about closing the common doors, in roughly the order below, and being able to recover quickly if something still gets through.
Before you start
- Access to cPanel, your CMS admin area (for example WordPress) and your domain registrar account.
- A password manager to create and store a different password for every account. The password generator works if you need one right now.
- A fresh full backup, made before you change permissions or delete old files.
The checklist
1. Lock down every login
List every account that can change your site: cPanel, FTP accounts, database users, CMS administrators, email accounts and the domain registrar. Give each a long, unique password; reused passwords are the most common way in, because one leak elsewhere opens everything.
Then turn on two-factor authentication: in cPanel under Security » Two-Factor Authentication, and in WordPress with a 2FA plugin. Delete FTP accounts and admin users you no longer need, and give people the lowest role that does the job (Editor, not Administrator, for someone who only writes posts).
2. Update everything and delete what you don’t use
Install updates for the CMS core, plugins and themes; in WordPress they’re all under Dashboard » Updates. Delete unused plugins and themes instead of just deactivating them: deactivated code still sits on disk and can still be called directly. Remove leftovers such as public_html/old/, backup.zip or a forgotten test install. And never install “nulled” (pirated) themes or plugins: they very often arrive with a backdoor already inside.
3. Run a supported PHP version
Old PHP versions no longer receive security fixes. Move to a current one after testing your site, as explained in choosing your PHP version.
4. Set safe file permissions
Folders should be 755, files 644, and configuration files with passwords stricter. Over SSH:
find ~/public_html -type d -exec chmod 755 {} \;
find ~/public_html -type f -exec chmod 644 {} \;
chmod 600 ~/public_html/wp-config.php
Without SSH, change them in Files » File Manager » Permissions. Never use 777; it lets any process write to the file. If you’re unsure what a number means, check it with the chmod calculator.
5. Stop PHP from running in upload folders
Attackers who manage to upload a file usually upload a PHP script and then open it in the browser. Block that in folders that should only hold images and documents. Create wp-content/uploads/.htaccess with:
<FilesMatch "\.(php|phtml|phar)$">
Require all denied
</FilesMatch>
Also hide folder listings with the first line below in the main public_html/.htaccess, and disable WordPress’s built-in theme and plugin editor with the second line in wp-config.php:
Options -Indexes
define('DISALLOW_FILE_EDIT', true);
6. Protect the login page
Use a username other than admin, keep 2FA on for every administrator, and limit failed attempts with a security plugin, which slows down brute-force password guessing. Don’t share one admin account between several people; each person gets their own, so you can remove access cleanly when someone leaves.
7. Encrypt everything with HTTPS
Without HTTPS, passwords typed on public Wi-Fi travel in clear text. Install the certificate and redirect all traffic as shown in force HTTPS on your site.
8. Back up, and test the restore
Keep backups for several days back, because an infection is often noticed days after it happens. Store at least one copy outside your hosting account (for example on your own computer or cloud storage), and try restoring it once to a test folder so you know the process works before you need it.
9. Watch for warning signs
Add your site to Google Search Console so you get an email if Google detects malware. Once a month, review admin users, cron jobs in Advanced » Cron Jobs, and recently changed files. Unknown entries in any of these are the first clue.
Troubleshooting
- A plugin stops working after you block PHP in uploads: a few badly written plugins run scripts from that folder. Check the plugin’s documentation, and prefer replacing the plugin over removing the protection.
- Locked out after enabling 2FA: use the backup codes you saved when you enabled it. For cPanel, contact support to verify your identity and reset it.
- Site shows a 403 after the permission change: a folder was set to
644by mistake. Folders need755so the web server can enter them. - You suspect the site is already infected: unknown admins, redirects to spam sites, strange files or spam sent from your domain. Stop hardening and follow cleaning up a hacked site first.
For WordPress-specific settings, see the full WordPress security guide.
On ArabyHost
Imunify360 security runs on ArabyHost servers, and every account is isolated with CloudLinux CageFS and its own resource limits (LVE), so a compromised site in another account can’t read your files. Note that CageFS separates accounts, not the sites inside one account: all domains in your cPanel account share the same files and user, so a forgotten old install can infect your other sites, which is another reason to delete what you don’t use. Free SSL is issued automatically, PHP 8.1, 8.2 and 8.3 are available, and daily JetBackup backups let you restore an earlier copy of your files or databases from cPanel, opened with one click from the Araby Panel. Arabic support can help if you notice something suspicious.
FAQ
Is a small website really a target?
Yes. Most attacks are automated bots that scan the internet for known vulnerable plugins and weak passwords; they don't pick sites by size. A small site is often abused to send spam or host phishing pages.
Is a security plugin enough on its own?
No single tool is enough. A plugin helps, but updates, strong passwords, two-factor authentication and backups prevent most incidents, and no plugin can fully protect a site running an outdated, vulnerable theme.
How often should I update plugins and themes?
Check at least weekly and install security updates as soon as they're released. Automatic updates for trusted plugins close the gap between a fix being published and bots starting to exploit the flaw.