Website created on CMS (Content Management System) like Joomla, Drupal and WordPress are more prone to hacking. Hackers do this just for the sake of practicing. Most of them don’t steal anything or erase any files on your server. They only replace you index file or home page. But just to make sure, that you won’t lose anything, do a regular backup of your website files. If you got hacked, don’t panic. Here’s a guide on how to restore/reinstall your WordPress site.
Step 1: Login to your WordPress admin.
Step 2: Select Dashboard on your Navigation menu.
Step 3: Click on Updates
Step 4: Hit the Re-Install Now button.
Step 5: Follow as instructed and you’re done.
This will re-create your lost index file but reset all manually modified widgets to default. As for Joomla and Drupal, restoring the index files manually will do the trick.
Tips: You can either backup your database on a regular basis or export your wordpress blog from time to time to make sure you have a copy of all your post, comments, pages, etc. You can never say when will you need this.