If your WordPress website is hacked, the first step is to isolate and remove any malicious code. You should then change all passwords associated with your website, and restore from a backup.