I have been hacked and someone is adding scripts that redirects all pages, how do I stop this ?

Please I need urgent attention, this is the third time the hacker is adding redirect script on all the web posts… All of them,

There is security breach somewhere.

aNY Help !

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Hi there,

You can install malware detection software like Linux Malware Detect, also known as Maldet or LMD. It will help you to locate any malicious files on your droplet.

If you’re interested in securing your droplet (everyone should be in general) you can double-check our tutorial - An Introduction to Securing your Linux VPS.

The article will cover the basic and some more advanced steps in website and server security.

You can check the article here:

Hope that this helps!


Please note that the majority of the hacks reported are most likely due to outdated applications. Most of the times hackers leave backdoors in the document root of your website to regain access. It is also possible that some plugins have poor scripts, which allows hackers to insert various malformed queries and remotely execute the code and perform any intended action.

You can follow the below steps to harden your website security and prevent it from happening again.

  1. Scan the files and database. Wordfence plugin can be handy here.

  2. Make sure Dangerous PHP functions are disabled. Some common functions to rule out are eval, preg_replace, exec etc.

  3. Disable PHP execution in the uploads folder.

  4. Restrict wp-admin to certain IPs from which you access Wp-admin Dashboard.

  5. Remove unused themes and plugins.

  6. Limit Access to the Wp-Content Directory.

  7. Restrict access to PHP files from plugin and theme directories.

Most of the hardening rules will be configured via .htaccess and make sure that your WordPress core, plugins and themes are all up to date.

Let me know if you have any further questions.

Regards, Prakash Jha Developer Support

You need to either remove or update the “Wordpress Live Chat” plugin, since it has a vulnerability