Introduction: The Security Risks of Running WordPress
WordPress powers 40% of the web, which also means it powers 40% of the web’s security vulnerabilities. According to WPScan, over 90% of WordPress sites have at least one known vulnerability in their installed plugins or themes. The most common attacks include brute force login attempts, SQL injection, cross-site scripting (XSS), and malicious file uploads.
Many site owners assume that because their blog is “small,” no one will target it. This is dangerously wrong. Automated bots scan the entire IPv4 address space continuously, looking for vulnerable WordPress installations. Within hours of launching a new WordPress site on a default configuration, you will see login attempts from dozens of IP addresses.
RakSmart takes security seriously at every layer of their hosting stack. From physical data center security to network-level DDoS protection to OS-level hardening templates, RakSmart provides the building blocks for a secure WordPress environment. Their dedicated servers include hardware firewalls, and their VPS offerings can be configured with strict security groups.
In this guide, we will explore RakSmart’s native security features, then show you how to layer additional protections specifically for WordPress workloads. We will cover network isolation, filesystem permissions, login protection, and automated incident response.
RakSmart’s Built-in Security Advantages
Before adding your own security layers, understand what RakSmart already provides out of the box.
Physical and Infrastructure Security
RakSmart operates Tier III+ data centers across Asia. These facilities feature:
- Biometric access controls with two-factor authentication
- 24/7 on-site security personnel
- CCTV coverage with 90-day retention
- Redundant power feeds and backup generators
- Climate control with fire suppression systems
For WordPress sites that handle sensitive data — such as e-commerce stores with customer payment information — these physical controls may be necessary for compliance with PCI DSS.
Network-Level DDoS Protection
All RakSmart dedicated servers and VPS instances include DDoS mitigation up to 10Gbps. This is not an expensive add-on; it is standard. For WordPress sites that have become targets — perhaps due to controversial content or successful competitors — this protection is invaluable.
The mitigation stack automatically detects and filters:
- UDP floods
- SYN floods
- ICMP floods
- HTTP application layer attacks (including WordPress-specific XML-RPC amplification attacks)
China-Optimized CN2 with Built-in Filtering
RakSmart’s CN2 routes are not just about speed. China Telecom applies additional filtering and threat intelligence on CN2 traffic. For WordPress sites serving Chinese visitors, this means malicious inbound traffic (DDoS, brute force) is filtered closer to the source.
Pre-Hardened OS Images
RakSmart offers installation templates for Ubuntu, CentOS, Debian, and AlmaLinux that come pre-hardened. These images include:
- Root SSH login disabled by default
- Fail2ban preconfigured for SSH and WordPress login protection
- Automatic security updates enabled
- Auditd running with baseline rules
- Firewall (iptables/nftables) with default-deny inbound policy (only SSH and HTTP/HTTPS open)
When you deploy a RakSmart server, selecting these hardened images saves hours of manual security configuration.
Layered Security for WordPress Deployments
RakSmart provides the foundation, but WordPress-specific threats require additional layers. Here is a complete security architecture for production WordPress sites.
Layer 1: Filesystem Permissions and Hardening
WordPress’s biggest vulnerability is often its own filesystem. If the web server can write to WordPress core files, a compromised plugin can modify them.
Set correct permissions:
bash
# Set ownership: web server user owns files, but not write access everywhere
chown -R www-data:www-data /var/www/wordpress
# Directories: 755
find /var/www/wordpress -type d -exec chmod 755 {} \;
# Files: 644
find /var/www/wordpress -type f -exec chmod 644 {} \;
# wp-config.php should be read-only
chmod 400 /var/www/wordpress/wp-config.php
# Uploads directory needs write access
chmod 755 /var/www/wordpress/wp-content/uploads
Protect wp-config.php via Nginx:
nginx
location ~ /wp-config.php {
deny all;
}
Disable file editing from WordPress admin:
Add to wp-config.php:
php
define('DISALLOW_FILE_EDIT', true);
define('DISALLOW_FILE_MODS', true); // Also disables plugin/theme updates from admin
Layer 2: WordPress-Specific WAF Rules
Use Nginx to block common WordPress attacks:
nginx
# Block access to vulnerable files
location ~ /(xmlrpc\.php|wp\-config\.php|readme\.html|license\.txt|wp\-admin/includes/) {
deny all;
access_log off;
log_not_found off;
}
# Block XML-RPC brute force (allow only if needed)
location = /xmlrpc.php {
deny all;
access_log off;
log_not_found off;
}
# Protect against SQL injection
if ($query_string ~* ".*[\;'\<\>].*") {
return 403;
}
# Block common exploit patterns
set $block_ua 0;
if ($http_user_agent ~* (nikto|wikto|sqlmap|nessus|wpscan|acunetix)) {
set $block_ua 1;
}
if ($block_ua = 1) {
return 403;
}
Layer 3: Login Protection
WordPress’s default login page (/wp-admin and /wp-login.php) is attacked constantly.
Rename the login page (security through obscurity):
Use a plugin like WPS Hide Login to change /wp-login.php to something custom like /secure-access-xyz.
Rate limiting with Fail2ban:
Create /etc/fail2ban/filter.d/wordpress.conf:
ini
[Definition] failregex = ^<HOST> .* "POST /wp-login\.php.* HTTP/.*" 200 ignoreregex =
Create /etc/fail2ban/jail.d/wordpress.local:
ini
[wordpress] enabled = true port = http,https filter = wordpress logpath = /var/log/nginx/access.log maxretry = 5 bantime = 3600
Implement two-factor authentication:
Install a plugin like Wordfence Login Security or Google Authenticator. For WooCommerce stores, make 2FA mandatory for administrator accounts.
Layer 4: Database Security
The WordPress database contains everything: posts, pages, user emails, hashed passwords, and WooCommerce order data.
Use a strong database prefix:
Instead of the default wp_, set a custom prefix during installation: wp3x9_ or similar. This prevents SQL injection attacks that assume the default prefix.
Restrict database user permissions:
sql
-- WordPress only needs SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, ALTER GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, ALTER ON wordpress_db.* TO 'wp_user'@'localhost'; -- Do NOT grant GRANT OPTION or FILE privileges
Enable MariaDB query logging for suspicious activity:
ini
# In my.cnf log_warnings = 2 slow_query_log = 1 slow_query_log_file = /var/log/mysql/slow.log long_query_time = 2 # Log queries without indexes log_queries_not_using_indexes = 1
Layer 5: Plugin and Theme Management
Plugins are the leading cause of WordPress compromises.
Establish a plugin policy:
- Only install plugins from the official WordPress repository or trusted commercial vendors
- Delete unused plugins — not just deactivate
- Update plugins weekly, testing on a staging environment first
- Monitor plugin changelogs for security fixes
Use a plugin vulnerability scanner:
bash
# Install WPScan CLI gem install wpscan # Scan your site wpscan --url https://yoursite.com --enumerate vp,vt
Run this weekly and address any vulnerabilities immediately.
Layer 6: Automated Backups
Assume you will be compromised eventually. Backups are your recovery path.
Configure automated backups to remote storage:
bash
#!/bin/bash # /usr/local/bin/backup-wordpress.sh BACKUP_DIR="/backups" DATE=$(date +%Y%m%d) S3_BUCKET="s3://your-backup-bucket" # Backup database mysqldump -u root wordpress_db > $BACKUP_DIR/db-$DATE.sql # Backup files tar -czf $BACKUP_DIR/files-$DATE.tar.gz /var/www/wordpress # Upload to remote storage (RakSmart object storage or AWS S3) aws s3 cp $BACKUP_DIR/db-$DATE.sql $S3_BUCKET/db/ aws s3 cp $BACKUP_DIR/files-$DATE.tar.gz $S3_BUCKET/files/ # Keep 30 days locally, 90 days in S3 find $BACKUP_DIR -type f -mtime +30 -delete
Schedule daily via cron: 0 2 * * * /usr/local/bin/backup-wordpress.sh
Incident Response for WordPress on RakSmart
Even with perfect security, incidents happen. Have a plan.
Step 1: Identify the compromise
- Check for unexpected admin users
- Review recent file modifications:
find /var/www/wordpress -type f -mtime -1 - Check access logs for POST requests to wp-admin:
grep "POST /wp-admin" /var/log/nginx/access.log
Step 2: Isolate the site
Use RakSmart’s firewall API to block all traffic except your IP:
bash
ufw default deny incoming ufw allow from YOUR_IP to any port 22,80,443 ufw enable
Step 3: Restore from clean backup
Delete the compromised installation and restore from the most recent clean backup.
Step 4: Rotate all secrets
- Change WordPress admin passwords
- Change database passwords
- Regenerate salts in
wp-config.php - Revoke and reissue API keys for any integrations
Step 5: Post-incident review
Determine how the compromise happened. Was it a vulnerable plugin? A weak password? Add controls to prevent recurrence.
Conclusion: Security Is a Process, Not a Product
RakSmart provides the secure foundation — hardened servers, DDoS protection, physical security — but WordPress security requires ongoing attention. Implement the layers above: filesystem hardening, WAF rules, login protection, database security, plugin management, and automated backups. Your WordPress site will be safer, and you will sleep better.


Leave a Reply