Plugin conditional loading: how to activate and load WordPress plugins on selected pages or posts only

By default WordPress will enable all activated plugins on all WordPress posts and pages, and will load all relative CSS and JavaScript plugin files on these pages.

In some cases, you may want to only enable a plugin and load the relative files on some specific pages. For example, if your website has a gallery page, you may want to only enable the gallery plugin on this page, thus speed up the loading of other pages.

To accomplish this, you can use one of the following two free WordPress plugins.

Disclaimer: We are not associated with these plugins in any way, please use them at your own discretion.

1. Plugin Organizer

Plugin Organizer can change the order that the plugins are loaded, disable a plugin by default then enable it on specific pages, or enable a plugin by default then disable it on specific pages.

The plugin also supports enabling/disabling plugins based on user roles, post types etc.

You can download the plugin from the WordPress.org repository https://wordpress.org/plugins/plugin-organizer/.

2. Plugin Load Filter

Plugin Load Filter has an easy to use interface, you can download it from the WordPress.org repository https://wordpress.org/plugins/plugin-load-filter/.

The plugin supports the following features:

  • Support Post Format type
  • Support Custom Post type
  • Support Jetpack Modules filtering
  • Support WP Embed Content card (is_embed template)
  • Support Simple Post Language Locale switcher