Restoring the Joomla file system after a hack is not chaotic deletion of everything suspicious. The right approach divides the files into two groups: those that can be replaced with originals, and those that require manual cleaning. We have restored more than 150 sites after hacking and we know for sure: the right division saves days of work. Let us look at it in detail.
What Can Be Replaced with the Original
These files can be safely restored from official sources:
- The Joomla core — download the distribution of the same version.
- Standard extensions — take them from the official directory.
- System templates — download them from the developer.
- Library and framework files.
Replacing with the original guarantees that no malicious code remains in these files.
What Requires Manual Cleaning
Some files cannot be replaced because they are unique to your site:
- The
configuration.phpfile with database credentials. - Custom components written to order.
- Modified templates.
- Integration files with external services.
- Uploaded images and documents.
These files need to be checked manually and only the malicious fragments removed.
The Order of File Restoration
The right sequence:
- Make a backup of the current state.
- Replace the Joomla core with the original.
- Update the extensions to the official versions.
- Check the custom files manually.
- Check the database for malicious records.
How to Check Whether a File Is Infected
Signs of an infected file:
- The modification date does not match your actions.
- It contains the functions
eval,base64_decode,exec. - It differs from the original version of the same file.
- It contains requests to unfamiliar domains.
- It is in a non-standard location.
If a file raises suspicion — compare it with the original from an official source.
Mistakes in Restoration
Typical mistakes to avoid:
- Deleting all the files in a row — you can lose custom refinements.
- Replacing only the core without checking the extensions — the virus will remain in the components.
- Ignoring the database — malicious records will infect the files again.
- Restoring from an infected backup.
Restoration is not only replacing files but also finding the source of the infection.
When a Specialist Is Needed
Seek help if:
- Custom files are infected and there is nothing to replace them with.
- You are not sure which files are safe to replace.
- Malicious records are found in the database.
- The site does not work after a cleanup attempt.
Professional restoration is faster and safer than experiments. The Malicious Code Removal service includes scanning the files and the database, and for deep infection we connect Virus Removal — usually 1–2 days, urgently in 2–4 hours. If there is a lot of data and it is damaged — Recovery After a Hack.
"Replacing a file with the original is simple. The hard part is understanding which file can be replaced and which can only be cleaned manually."
If you are not sure which files are infected and how to restore them — do not take risks. A mistake can cost the site its operability.