WordPress Malicious Redirect Fix

In this article of WordPress Malicious Redirect Fix 2021, I am going to talk about fixing a very annoying issue of website redirects. Unfortunately because of rampant cyber attacks the number of website which gets hacked daily has increased significantly.

What is WordPress Malicious Redirect?

A hacker usually places malicious website’s URL in your website’s header or Site URL. This results in your website being redirected to someone other’s website. Mostly hackers do this in order to increase traffic on their own website.

WordPress Malicious Redirect Fix – Video Tutorial

If you are someone who prefers watching video tutorials than you can watch this video which details step by step fix.

Identifying Infectious content

Once you start noticing that your website is being redirected to some unusual website it is time that you should act immediately. Search engines can block your websites if it has malicious redirects.

Usually malicious contents are pasted in the header of your website. So you can try replacing wp-content folder with the backup folder which you have. However, hackers have really gotten smarter these days and they choose the path of updating your website’s database with these malicious URLs.

Identifying Infectious content In The Database

In order to verify malicious contents in the database you can run below SQL Query after loggin in to your website’s database.

select * from wp_options limit 2;

Above query should show you two records. Check the URLs under “option_value” column. Is it the URL of your website? Most probably, it is not. So in that case, you should update these URLs to your website’s URL. The Query to do that is below. Please make sure your change the URL to your website in below command before running it.

update wp_options set option_value='https://www.itpanther.com' where option_id in (1,2);

After making the change you can open your website again to test. You will notice that this time your website does not redirect to malicious URL. If your website does not get redirected any more than it means it is free from any malicious URLs now.

Scroll to Top