WordPress selective plugin loader

One of the most common problems in WordPress is the large number of plugins loaded in every single website page. Imagine you have a many plugins in your installation, thus every single one of them will be loaded every time a user requests a page from your website.

How many of those plugins though, are useful for a simple user? For example if you have WordPress Importer in your website is it useful this plugin to be loaded in the front-end?

In this article we are going to show how to selectively load plugins in every single page.

WordPress stores active plugins in wp_options table (the option is called active_plugins). If you want to see current active plugins simply call the following script:

Create a folder ( if does not exist ) in wp-content and name it mu-plugins



Now create a php file and give it a name e.g. custom-selective-loader.php. Inside this file paste the following code

Simply check if you are in a wp-admin page and if not do not load specific plugins! Follow this example to load specific plugins in every WordPress page!

Happy to hear your comments!

Development Tips
Next Post
Leverage Browser Cache