A hacked WordPress site is more than a technical inconvenience — for Singapore businesses, it can mean lost customers, damaged reputation, and potential PDPA compliance issues. WordPress powers over 43% of all websites globally, and Singapore is no exception. The same popularity that makes WordPress accessible also makes it the most targeted CMS on the internet.
This guide documents the exact process our team follows when a Singapore business calls us with a hacked WordPress site. Whether you handle the repair yourself or hire a professional, understanding these steps will help you make informed decisions.
How WordPress Sites in Singapore Get Hacked
Before repairing the damage, understanding the entry point prevents it from happening again. In our experience with Singapore clients, these are the most common attack vectors:
1. Outdated Plugins (65% of Cases)
The single biggest cause. A Singapore retailer running WooCommerce with 15 plugins has 15 potential entry points. When a plugin like Contact Form 7 or Elementor releases a security patch — see the hidden risks of third-party plugins — and you delay updating by even a week, automated bots have already found your site.
2. Compromised Hosting Accounts (20% of Cases)
Singapore budget hosting providers often place hundreds of accounts on a single server. If one account gets compromised through a weak password or vulnerable script, attackers can pivot to neighbouring accounts through symlink attacks or shared /tmp directories.
3. Stolen Credentials (10% of Cases)
Reused passwords, phishing emails, or malware on the site owner's computer. We have seen Singapore business owners use the same password for their WordPress admin, cPanel, and email — one breach exposes everything.
4. Supply Chain Attacks (5% of Cases)
Nulled (pirated) themes and plugins downloaded from unofficial sources. This is a form of supply chain attack. These come pre-infected with backdoors. We see this frequently with Singapore freelancers who use nulled premium themes to save costs.
The First 30 Minutes: Emergency Response
When you discover your WordPress site has been hacked, these first steps are critical:
Immediate Actions
# 1. Document the hack — take screenshots of every symptom
# 2. Check when files were last modified
find /var/www/html -type f -name "*.php" -newer /var/www/html/wp-includes/version.php
# 3. Save access logs before they rotate
cp /var/log/apache2/access.log ~/hack-evidence/
cp /var/log/apache2/error.log ~/hack-evidence/
# 4. Save a full database dump as evidence
mysqldump -u root -p your_database > ~/hack-evidence/db-backup.sql
Do NOT Do These Things
- Do not delete everything and reinstall — you will destroy forensic evidence and may miss deeply embedded backdoors
- Do not just restore a backup — the backup may already contain the initial vulnerability. You need to identify and patch the entry point first
- Do not change only the admin password — attackers typically create multiple persistence mechanisms
Phase 1: Forensic Analysis
Understanding exactly what happened is essential for a clean repair. Here is our forensic checklist:
File System Analysis
# Find PHP files modified in the last 7 days (adjust as needed)
find /var/www/html -name "*.php" -mtime -7 -ls | sort -k9
# Find files with suspicious permissions (world-writable)
find /var/www/html -type f -perm -o+w -ls
# Look for PHP files in upload directories (should never exist)
find /var/www/html/wp-content/uploads -name "*.php" -ls
# Check for hidden files and directories
find /var/www/html -name ".*" -not -name ".htaccess" -ls
# Search for common backdoor signatures
grep -rl --include="*.php" "eval(\|base64_decode\|gzinflate\|str_rot13\|gzuncompress" /var/www/html
Database Analysis
-- Check for rogue admin accounts
SELECT ID, user_login, user_email, user_registered
FROM wp_users
JOIN wp_usermeta ON wp_users.ID = wp_usermeta.user_id
WHERE wp_usermeta.meta_key = 'wp_capabilities'
AND wp_usermeta.meta_value LIKE '%administrator%'
ORDER BY user_registered DESC;
-- Look for injected content in posts
SELECT ID, post_title, post_date
FROM wp_posts
WHERE post_content LIKE '%<script%'
OR post_content LIKE '%iframe%'
OR post_content LIKE '%eval(%'
LIMIT 20;
-- Check for malicious scheduled events (WP Cron)
SELECT option_value FROM wp_options WHERE option_name = 'cron';
-- Inspect siteurl and home — attackers sometimes change these
SELECT option_name, option_value
FROM wp_options
WHERE option_name IN ('siteurl', 'home', 'active_plugins', 'template', 'stylesheet');
Access Log Analysis
# Find POST requests to unusual PHP files (potential backdoor usage)
grep "POST" /var/log/apache2/access.log | grep -v "wp-login\|wp-admin\|wp-cron\|admin-ajax" | tail -50
# Find requests from the attacker's IP (once identified)
grep "ATTACKER_IP" /var/log/apache2/access.log | head -100
# Check for brute force attempts
grep "wp-login.php" /var/log/apache2/access.log | awk '{print $1}' | sort | uniq -c | sort -rn | head -20
Phase 2: Malware Removal and File Restoration
Once we understand the infection, systematic cleanup begins:
Core WordPress Files
- Download a fresh copy of your exact WordPress version from wordpress.org
- Replace every file in
wp-admin/andwp-includes/with the clean copy - Compare
wp-config.phpline by line — restore to clean version but keep your database credentials, salts, and table prefix - Replace
index.php,wp-login.php,wp-settings.php,xmlrpc.php, and all other root-level PHP files
Plugins and Themes
- List every installed plugin with its exact version
- Download fresh copies from WordPress.org (or the vendor for premium plugins)
- Delete the entire
wp-content/plugins/directory and reinstall from clean copies - Repeat for themes — keep only your active theme and a default theme (like Twenty Twenty-Four)
- Delete all inactive themes and plugins — they are attack surface with no benefit
Upload Directory Cleanup
# The uploads directory should ONLY contain media files
# Remove any PHP, JS, or executable files
find /var/www/html/wp-content/uploads -type f \( -name "*.php" -o -name "*.phtml" -o -name "*.js" -o -name "*.sh" \) -delete
# Check for files disguised with double extensions
find /var/www/html/wp-content/uploads -type f -name "*.php.*" -o -name "*.jpg.php" -o -name "*.png.php"
Database Cleanup
-- Remove rogue admin accounts
DELETE FROM wp_users WHERE user_login NOT IN ('your_actual_admin_username');
-- Clean injected JavaScript from posts (review before running)
UPDATE wp_posts SET post_content = REPLACE(post_content, '<script src="https://malicious-domain.com/inject.js"></script>', '') WHERE post_content LIKE '%malicious-domain.com%';
-- Reset all user passwords (forces everyone to reset)
UPDATE wp_users SET user_pass = '';
-- Regenerate security salts (do this in wp-config.php too)
-- Visit https://api.wordpress.org/secret-key/1.1/salt/ for new values
Phase 3: Hardening for Singapore Business Sites
After repair, we implement these hardening measures specifically tailored to Singapore WordPress deployments:
Server-Level Hardening
# .htaccess — Block PHP execution in uploads
<Directory /var/www/html/wp-content/uploads>
<FilesMatch "\.php$">
Deny from all
</FilesMatch>
</Directory>
# Restrict wp-login.php access (optional — by Singapore IP range)
<Files wp-login.php>
Order Deny,Allow
Deny from all
Allow from 116.0.0.0/8
Allow from 175.0.0.0/8
Allow from 202.0.0.0/8
</Files>
WordPress Configuration Hardening
// Add to wp-config.php
// Disable file editing from the WordPress dashboard
define('DISALLOW_FILE_EDIT', true);
// Limit post revisions to reduce database bloat
define('WP_POST_REVISIONS', 5);
// Force SSL for admin area
define('FORCE_SSL_ADMIN', true);
// Block external HTTP requests (whitelist as needed)
define('WP_HTTP_BLOCK_EXTERNAL', true);
define('WP_ACCESSIBLE_HOSTS', 'api.wordpress.org,downloads.wordpress.org');
Essential Security Plugins for Singapore Sites
- WO Security Shield — real-time file integrity monitoring, checksum verification against WordPress.org, and instant alerts
- Two-Factor Authentication — mandatory for every admin account
- Limit Login Attempts — block brute force attacks at the application level
Ongoing Monitoring
- Daily file integrity scans — WO Security Shield compares your files against known-good checksums automatically
- Weekly full-site backups — stored off-server (S3 ap-southeast-1 or similar)
- Monthly plugin audit — remove anything you do not actively use
- Quarterly security review — check user accounts, review access logs, verify backup restoration works
Recovery Timeline for Singapore Businesses
Based on our Singapore client engagements, here is what to expect:
| Phase | Duration | What Happens |
|---|---|---|
| Emergency response | 1–2 hours | Site isolated, evidence preserved, temporary maintenance page |
| Forensic analysis | 2–4 hours | Entry point identified, full scope of infection mapped |
| Malware removal | 3–8 hours | All malicious code removed, files restored from clean sources |
| Hardening | 1–2 hours | Security measures implemented, monitoring configured |
| Google review | 1–3 days | Security warning removed from search results |
| Ranking recovery | 1–4 weeks | Search rankings return to pre-hack levels |
Total professional repair time: typically 8–16 hours from first contact to a fully cleaned and hardened site.
When to Consider a Fresh Installation
Sometimes repair is not the most cost-effective option. We recommend starting fresh when:
- The site has been compromised for more than 6 months (infection is deeply embedded)
- The site runs on a very old WordPress version (4.x or earlier) with no clear upgrade path
- There are more than 30 plugins and the site owner cannot identify which ones are actually needed
- The original developer is unavailable and there is no documentation of customisations
- Budget is limited and the site is simple enough to rebuild in less time than a thorough cleanup
For Singapore SMEs with straightforward brochure sites, a fresh WordPress installation with proper security from day one often costs less than a deep forensic cleanup.
Protect Your Singapore WordPress Site
Do not wait for a hack to take security seriously. WO Security Shield provides continuous file integrity monitoring, real-time alerts, and WordPress-specific security hardening — all running inside your WordPress dashboard. If the worst happens, our emergency response team is available to Singapore businesses with priority turnaround times.
Related Articles
- Website Malware Cleanup in Singapore: A Step-by-Step Guide — broader malware cleanup guide covering all platforms
- WordPress Security Incident Response: What to Do in the First 60 Minutes — detailed first-hour response protocol
- How Malware Hides Inside WordPress Plugins — understand what you are looking for during cleanup
- The WordPress Security Checklist Every Singapore Business Should Follow — post-repair hardening checklist
- WordPress Backup Strategy: How to Recover from Any Attack — ensure you never lose data again
