Security Blog
Security Blog

What to do if your WordPress site has been hacked


  1. Immediately change passwords. Your WordPress user account and all accounts with administrative permissions on the website. MySQL password for your website database and password for MySQL server administrator. FTP, if it used.
  2. Reinstall WordPress. Manually remove old one and install again (don’t forget preserve uploads folder). Download latest stable release from wordpress.org.
  3. Reinstall all plugins and theme. Use latest stable releases. Reinstall means remove all folders and files from previous installation. Don’t copy new files over files and folders that exists.
  4. Change security keys in the wp-config.php file. Get it from: https://api.wordpress.org/secret-key/1.1/salt/
  5. Make chmod 444 for wp-config.php.
  6. Check uploads folder(s) for php files. Remove it without doubt.
  7. Put .htaccess file to the uploads folder with string in it
    php_flag engine off
  8. Check theme with Theme Check plugin.

Last posts from WordPress security blog


I'm a team lead in Cerber Tech. I'm a software & database architect, WordPress - PHP - SQL - JavaScript developer. I started coding in 1993 on IBM System/370 (yeah, that was amazing days) and today software engineering at Cerber Tech is how I make my living. I've taught to have high standards for myself as well as using them in developing software solutions.

View Comments
There are currently no comments.