أهم النقاط
- Change every password first — hosting, cPanel, FTP, database and admin users.
- Restoring a clean backup is often faster than cleaning file by file.
- Find how the attacker got in, or it will happen again.
1. Contain
- Change passwords for your hosting client area, cPanel, FTP/SFTP accounts, the database user and every administrator account. Enable 2FA.
- Take a copy of the infected site (files and database) for investigation before you change anything else.
- If the site is redirecting visitors to malware, put up a maintenance page.
2. Clean
Fastest: restore a backup from before the infection, then update everything.
If there’s no clean backup:
- Reinstall WordPress core files from a fresh download (keep
wp-contentandwp-config.php). - Reinstall every plugin and theme from the official source; delete ones you don’t use.
- Search
wp-content/uploadsfor.phpfiles — there normally shouldn’t be any. - Review
wp-config.phpand.htaccessfor code you didn’t add. - In the database, remove unknown administrator users and check for injected
<script>tags.
3. Close the hole
Common entry points: an outdated plugin, a nulled theme, a reused password, or an infected local computer. Update everything, remove anything unused, and scan your own devices.
4. Recover your reputation
- Request a review in Google Search Console if Google flagged the site.
- Check whether your server’s IP was used to send spam and is blocklisted.
- Keep monitoring logs for a few weeks.
الأسئلة الشائعة
How do I know my site is hacked?
Common signs: redirects to spam sites, a browser 'Deceptive site' warning, unknown admin users, strange files, a sudden traffic or email spike, or a warning from your host or Google.
How do I get my site off Google's warning list?
After cleaning, open Search Console → Security & Manual Actions → Security issues, and request a review. Reviews usually complete within a few days.