3 Quick Steps to Stop WordFence Scan Running Forever

How to stop WordFence scan not finishing

WordFence is an invaluable security plugin for every site owner.

It is free and has a ton of features. 

Besides regular security protection, it lets you scan your site, find and remove viruses and malware.

But sometimes WordFence scan gets stuck.

This can get very frustrating, as there is no button to stop it.

And the scan can literally run for hours or days…

Here’s what You Should do to Stop WordFence Scan getting stuck

It always works on our clients’ sites and will work on yours.

In your WordPress Dashboard head over to Plugins.

WordPress Dashboard Plugins Tab

Find WordFence and deactivate it.

Deactivate WordFence

Reload the page and reactivate WordFence.

In your WordPress Dashboard go to WordFence.

WordFence tab in WordPress Dashboard

The WordFence Scan tab will open. 

If the scan stopped, congrats! You are done.

It’s the first simple solution that we always try.

If the scan did not stop not, go to WordFence Options tab scroll down to Advanced Options.

Advanced Options WordFence

In Advanced Options go down to “Delete Wordfence tables and data on deactivation” and mark this option.

Delete WordFence Database Tables

Scroll down to the very bottom of the page and Save Changes.

Before you proceed, note down all your WordFence current Options.

You will have to set them again after re-activating the plugin.

After it’s done, head over to Plugins, find WordFence and deactivate it.

Deactivate and stop WordFence scan running forever

Reload the page and reactivate WordFence.

Activate WordFence

After it’s done, head over to WordFence Scan.

If you have done everything correctly, the scan has stopped.

The WordFence scan stops because after deactivating the plugin, ALL WordFence data has been removed from your WordPress database.

Now head over again to WordFence Options page and reset all previous settings you had.

After your settings are in place go to WordFence Scan tab and run the scan again.

Run WordFence Scan

If WordFence scan hangs again then you most likely have a memory issue.

To fix this look up your memory limit in php.ini file on your server.

If you do not know what I am talking about or don’t want to waste time on this things, there is a quick solution.

Install WordPress plugin WP Memory Load and db size Usage.

 Usage WordPress Plugins

The plugin displays your overall memory limit and how much WordFence uses during a scan.

After you have installed and activated the plugin, scroll down and look at the very bottom of your WordPress Dashboard page.

You will see something similar to the picture below.

In this screen shot the first number db 4.875M is the size of your WordPress database.

How to view WordPres Memory Limit

The second Mem 7.97 is how much memory is currently in use.

The third number 256M is your total memory limit.

Now, let’s head back to WordFence Options.

By default WordFence can use up to 256M of your server’s memory during a scan.

If your memory limit is less 256M, in the Options tab scroll down to Advanced Options and find this field “How much memory should Wordfence request when scanning.”

Memory usage during WordFence scan

Set this option to 3/4 of your WordPress memory limit.

So, if, for example, your memory limit is 128M then you should set WordFence limit to around 90M.

Set new memory limit

Next set “Maximum execution time for each scan stage” to 30.

If you are on cheap shared hosting then set maximum execution time to 15.

Scroll down and Save Changes

Go to the Scan tab and run the scan again.

Run WordFence Scan

These steps is the maximum we have ever required to stop WordFence scan from hanging forever. 

If this did not help, please, describe your issue in the Comments or send it to us via the Contact page.

We will do our best to solve it for you for free!

 

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

How much is Time limit is exhausted. Please reload CAPTCHA.