My site was hacked or has malware
The process of page caching makes a copy of your site's content and stores it in HTML files. This process cannot distinguish between your normal content and hacked content. This means that if your site has been hacked, and malware or other malicious content is injected into your pages, that content will also end up in the cache files. For this reason security plugins may warn you about malicious code in the cache files. This does not mean that WP Rocket is the reason your site was hacked. It's simply caching the already hacked content.
If your site has been hacked you should follow these steps:
- Disable Preloading in WP Rocket
- Clear the cache to remove the infected files (this can also be done manually if needed)
- Deactivate WP Rocket
- Clean up the hack on your site
- Once your site is clean, then you may reactivate WP Rocket.
If you need help to clean your hacked site, this is a good starting point: