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!

Suggestie? Vraag of opmerking? Laat het ons weten!

Plaats hier je bericht

Reacties (0)