Add Plugins to WordPress Theme

Let me make a recommendation: do not bundle plugins with your theme!

On first glance, yes this is a very easy way to add default functionality with your theme, but there are a slew of reasons not to include the plugins this way:

  1. Updates: If the plugin is freely available from WordPress.org already, then so are automatic updates to the plugin. The original author can add features, fix bugs, and deploy them quickly. Your clients and customers then benefit from on-going development. If you were to package them in your theme, though, you are essentially freezing the code at that point in time – any further updates, bug fixes, etc. would have to come from you. This means you’ll need to continuously release theme updates whenever the included plugins update.
  2. Updates: When WordPress updates, some plugins will break. This is because the original authors didn’t take the time to remove deprecated functionality or test with new versions of WP. Do you really want to commit to maintaining your theme + someone else’s code?
  3. Interoperability: As the great mfields once said, “If you’re building a bathroom and you change the wallpaper, the toilet shouldn’t disappear, too.” Users should be able to swap out themes whenever they want without losing their content, their custom data, or the additional functionality they have on their site. Remember, themes are meant for presentation, plugins are meant for functionality.

There have been plenty of other people who’ve talked about this in the past.

The better way to do this would be to have your theme check for specific plugins and prompt the user for installation if they’re missing.

Leave a Comment