Estimated reading time: 3 min
Applying critical security measures to your WordPress site is essential to protect against hacks, malware, and other cyber threats. Since you’re using Hostinger VPS with AlmaLinux, here are the most important security steps you should take:
🔒 Server-Level Security
- Use a Firewall (WAF)
- Install CSF (ConfigServer Security & Firewall) for AlmaLinux.
- Enable ModSecurity in cPanel to block malicious requests.
- SSH Hardening
- Change the default SSH port (22) to something else.
- Disable root login (
PermitRootLogin no
in/etc/ssh/sshd_config
). - Use SSH keys instead of passwords.
- Regular System Updates
- Keep AlmaLinux, PHP, MySQL, and cPanel updated.
- Run
dnf update -y
regularly or set up automatic updates.
- Disable Unused Services
- Turn off unnecessary services (
systemctl disable <service>
). - Close unused ports using iptables or firewalld.
- Turn off unnecessary services (
- Enable Fail2Ban
- Prevent brute force attacks on SSH, cPanel, and WordPress login.
🛡️ WordPress Security Measures
- Use a Security Plugin
- Install Wordfence or iThemes Security to monitor threats.
- Limit Login Attempts
- Set login attempt limits with Limit Login Attempts Reloaded plugin.
- Disable XML-RPC
- Prevent DDoS and brute force attacks by disabling XML-RPC (
Disable XML-RPC
plugin).
- Prevent DDoS and brute force attacks by disabling XML-RPC (
- Use Strong Passwords & 2FA
- Enforce strong passwords using the Password Policy Manager plugin.
- Enable two-factor authentication (2FA) via Wordfence or Google Authenticator.
- Restrict WP-Admin Access
- Limit access to
/wp-admin
using.htaccess
rules:<Files wp-login.php> order deny,allow Deny from all Allow from YOUR_IP </Files>
- Limit access to
- Change WP Login URL
- Use WPS Hide Login plugin to change
/wp-login.php
to something unique.
- Use WPS Hide Login plugin to change
- Disable File Editing
- Prevent attackers from modifying themes/plugins in
wp-config.php
:define('DISALLOW_FILE_EDIT', true);
- Prevent attackers from modifying themes/plugins in
📂 Database & File Security
- Change Database Prefix
- Change
wp_
to a random prefix (wp3x4y_
) during installation.
- Change
- Restrict Database Access
- Use strong MySQL user passwords.
- Limit database user privileges (no
GRANT
orDROP
permissions).
- Secure wp-config.php
- Move
wp-config.php
above the public_html directory. - Restrict access using
.htaccess
:<Files wp-config.php> order allow,deny deny from all </Files>
- Move

🚀 Backups & Monitoring For Critical Measures
- Daily Backups
- Enable Hostinger’s automatic backups or use UpdraftPlus.
- Monitor File Changes
- Install Sucuri Security or Wordfence for real-time file change monitoring.
- Scan for Malware
- Regularly scan with MalCare or Virusdie.
- Enable Logging
- Monitor
/var/log/auth.log
,/var/log/messages
, and/var/log/httpd/access_log
.
- Monitor
- DDoS Protection
- Use Cloudflare CDN & DDoS Protection.
🔑 Final Steps
Run a security audit using Wordfence Scanner.
Set up automatic software updates.
Use a reliable security plugin like All In One WP Security & Firewall.
Discover more from HelpZone
Subscribe to get the latest posts sent to your email.