Support

Admin Tools for WordPress

#41819 Disable Site Health Malware Scan Warning

Posted in ‘Admin Tools for WordPress’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Environment Information

WordPress version
n/a
PHP version
n/a
Admin Tools version
n/a

Latest post by sjberry1963 on Wednesday, 09 April 2025 14:25 CDT

sjberry1963

Hey There,

 

I noticed the new feature for adding the Malware Scan warning to the dashboard.

 

Since this operation is so intensive, I do not want this warning to appear on the dashboard at all.

I can/do/will do that as necessary.

 

How can I remove this?

 

Is there any way to disable this by default, since if not, I will have to visit every site to turn it off manually.

 

Thanks for your help.

 

Steve

nicholas
Akeeba Staff
Manager

Unfortunately, WordPress does not give a straightforward UI to customise the Site Health data sources. You have write some PHP code in a must-use plugin. It's easier than it sounds, just annoying when you're coming from Joomla :)

Create a new file wp-content/mu-plugins/sitehealth_customisation.php (the name is up to you, as long as it's in this folder) with the following code:

<?php
add_filter(
'site_status_tests',
function (array $tests): array
{
if (isset($tests['direct']['admintools_malware']))
{
unset($tests['direct']['admintools_malware']);
}

if (isset($tests['direct']['admintools_scanner']))
{
unset($tests['direct']['admintools_scanner']);
}

return $tests;
},
100
);

This removes the “Admin Tools PHP Scanner” and “Admin Tools Malware detection” items from the Site Health page.

The other two items we define are admintools_waf for “Admin Tools WAF”, and admintools_htaccess for “Admin Tools Htaccess Maker”. In case you want to remove them duplicate one of the if-blocks and change the admintools_malware item with the one you want to remove.

Pro tip: Once you get it working on one site all you have to do is copy the file you created on all other sites, at the same location relative to the site's root.

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

sjberry1963

Perfect.  I'll add this to my plugin and the next time it updates, it will go to the sites.

 

Thanks for your help.!