Jan Pulpán
Jan Pulpán

Reputation: 85

Remove cache after hacked Wordpress site

My Wordpress website got hacked. It redirected the user to some spam website. Since than I already cleaned the website and the problem does not occur anymore.

The problem is, that my visitors are still redirected to the spam website until they clean they cache or stop the redirect and reload the page.

I'm not really sure what to do, to fix this. I know I can't remove the user's cache remotely, but there sure must be some way how to tell their browser, that there are changes on the site before the redirect starts.

I already added this code to the website:

<meta http-equiv="cache-control" content="max-age=0" />
<meta http-equiv="cache-control" content="no-cache" />
<meta http-equiv="expires" content="0" />
<meta http-equiv="expires" content="Tue, 01 Jan 1980 1:00:00 GMT" />
<meta http-equiv="pragma" content="no-cache" />

Any ideas?

Upvotes: 8

Views: 936

Answers (2)

Akalanka Ekanayake
Akalanka Ekanayake

Reputation: 199

  1. Run malware scan using a plugin like Wordfence Security. (It will help you to find malicious files and codes)
  2. Open the WP-Content Folder
  3. Open the “Cache” folder
  4. Then open each folder and delete the contents stored inside them. Do not delete the folders (Either you can clear Cache using a plugin like WP Fastest Cache.

Upvotes: 0

Gufran Hasan
Gufran Hasan

Reputation: 9401

I faced this issue also I added this code to my .htaccess file get rid of it. Please try it.

<IfModule mod_expires.c>
ExpiresActive on
ExpiresDefault "access plus 1 month"
ExpiresByType image/gif "access plus 1 month"
ExpiresByType image/png "access plus 1 month"
ExpiresByType image/jpg "access plus 1 month"
ExpiresByType image/jpeg "access plus 1 month"
ExpiresByType text/html "access plus 3 days"
ExpiresByType text/xml "access plus 1 seconds"
ExpiresByType text/plain "access plus 1 seconds"
ExpiresByType application/xml "access plus 1 seconds"
ExpiresByType application/rss+xml "access plus 1 seconds"
ExpiresByType application/json "access plus 1 seconds"
ExpiresByType text/css "access plus 1 week"
ExpiresByType text/javascript "access plus 1 week"
ExpiresByType application/javascript "access plus 1 week"
ExpiresByType application/x-javascript "access plus 1 week"
ExpiresByType image/x-ico "access plus 1 year"
ExpiresByType image/x-icon "access plus 1 year"
ExpiresByType application/pdf "access plus 1 month"
<IfModule mod_headers.c>
   Header unset ETag
   Header unset Pragma
   Header unset Last-Modified
   Header append Cache-Control "public, no-transform, must-revalidate"
   Header set Last-modified "Mon, 1 Apr 2017 10:10:10 GMT"
 </IfModule>
 </IfModule>

Upvotes: 0

Related Questions