Today I want to ask you something which is really important what if my WordPress website https://thecodezine.com gets hacked or my jetpack plugin security is broken?Will I lose everything? Is there no way to get back? How can I get all my files safe and secured.
This is a multi prong question. It sounds like you are asking what to do if your site gets hacked in the future, but it is vague enough that you might be implying it has already been hacked.
If you have not been hacked yet, download a backup of your site as soon as possible and do this frequently. Keeping the last 3 or more site backups can really save you down the road. Second, install a security program of some sort. This could be something like Wordfence or paying your hosting provider. Either way, secure your site to prevent known attacks by using the appropriate service, professionals, or software. Always keep your WordPress Version up to date as well as your plugins.
If you site has already been hacked then your options are limited. You can hire a professional to see if they can find the malicious code. You could say 'who cares' and loose all of your data on your site and start over. Or, you can try to reconstruct what you can by using cached versions of your site (like Google) to pull content. Either way, you will need to reinstall your WordPress to overwrite the malicious code and may need to wipe your database clean too.
Remember the old adage that an ounce of prevention is worth a pound of cure.
Agree with Chris Thomas. Here's some practical advice. At a minimum, purchase UpDraft Plus and get some regular offsite backups going (Google Drive, Dropbox, etc or something similar) You might also investigate VaultPress or something similar. (Google VaultPress alternatives) Just get backups started by getting something going that is offsite (known as redundancy) and automated.
What they said.
And then be aware of how to recover from an attack - how to restore things. Know that a database backup is only a start. Also need to backup any custom files (child themes, custom code in a functions.php file).
And how to recover from an 'admin-hit-by-a-bus' scenario. And securing your site. And updates.
Many helps on the googles on backups, etc.
I'd recommend you to install the wordfence security plugin. Wordfence sends you alerts if your site gets compromised.Also, if it gets hacked wordfence can fix them and delete the hacked files. You also need to install backup plugins like updraftplus, these plugins can take backups at regular intervals so that you can restore your website with these backups(in case if it gets hacked)