Removing a plugin, but only on frontend Blog, The quest for page speed
Do you have a plugin that is heavy or unneccesary on the frontend?
Use this mu-plugin code to stop this plugin from loading on your website ( it will still be working on your wp-admin backend ! )
This example stops 1 plugin from loading, feel free to adjust the $remove_plugins array according to your needs.
<?php
/**
* @author: Ramon Fincken, MijnPress.nl RamonFincken.com
* http://www.mijnpress.nl/2014/removing-a-plugin-but-only-on-frontend
*/// Remove plugins from frontend, this may not work on multisite
function remove_plugins_frontend($plugins)
{
$remove_plugins = array('simple-add-pages-or-posts/simple_add_pages_or_posts.php');if(is_array($remove_plugins) && count($remove_plugins) > 0)
{
foreach($remove_plugins as $del_val)
{if(($key = array_search($del_val, $plugins)) !== false) {
unset($plugins[$key]);
}
}
}return $plugins;
}
if(!is_admin())
{
add_filter('option_active_plugins','remove_plugins_frontend');
}
?>
Laadtijd optimalisatie? Direct regelen!
- WordPress door ons op laadsnelheid laten bijwerken? Door Nederlandse experts? Dat kan! Stuur ons direct een bericht.
- Heef u een betrouwbare managed server nodig, die razendsnel uw WordPress website op het scherm tovert? Laat ons uw wensen weten en we maken er werk van.