A couple of weeks ago, I read a post on WPLift Build A Plugin (Twitter Widget) into your WordPress Theme)” which in turn was inspired by a post on WPCandy from a couple of months ago “How to create your own WordPress functionality plugin”.

The WPCandy post was advocating that theme designers should stop bundling WordPress plugins and other functionality which limits how easily users can switch themes, something which I feel is absolutely a good idea. But that’s not what I want to talk about in this post — I want to focus specifically on the issue raised in the WPLift post — building plugins directly into themes.

The post shows you how to add the DP Twitter Widget into your theme; it’s literally a case of copying a pasting the plugin’s code into your functions.php. In fact it’s so easy that there’s no reason not to build every single widget and plugin you can think of under the sun into your theme, right?

Not exactly.

Unfortunately it’s a little more complicated than that and for the rest of this post I’ll set out exactly why that’s the case.

Firstly, the second you build a plugin into your theme, you’re assuming responsibility and are obliged to support the plugin, so if anything breaks in future updates, you’ll need to be able to fix it. Say the plugin used Ben’s timthumb and updating was an absolute necessity, the onus would then be on you to provide the update by offering an entire theme upgrade rather than just a simple plugin update independent of the theme.

Second, what’s the point? The functionality you’re providing already exists and unless you’re significantly changing the plugin, I’m struggling to see the point of just duplicating functionality. Sure, you get to brag about how your theme has thousands upon thousands of built in widgets and it makes everything really fun and it’ll do everything you’ve ever wanted, but by just adding a plugin that already exists into your theme, you’re just adding something I can do already by installing plugins. Plus, I’ll not lose everything in two years when I decide I need to overhaul the look of my site! And hey, there are sites like mine out there which show you how to do things like building a WordPress powered email newsletter without plugins anyway!

I’m not just wagging fingers from the rooftops — this was a mistake I made when I launched my ill fated theme site, WPShift nearly two years ago. At the time having a ton of functionality in a theme was the way to go and we made a decision that we would go down the route of essentially just bundling plugins with the theme.

I’m glad to say this isn’t all the range any more, so please don’t do it, it’s just making a mess in the long run.

Hi, I'm Alex Denning. I run a site called WPShout.com where I publish WordPress Tutorials. You should follow me on Twitter @AlexDenning!

  1. You are so right. I’ve been frustrated for years by themes that build in functions better handled by plugins, and the TimThumb debacle should have been the nail in the coffin of that practice. It’s irresponsible for anyone to advocate doing it–though making such a controversial statement is one way to get attention.

  2. Ed - Blogrescue says:

    I agree wholeheartedly, and would add one more critical reason – Security! Case in point is the timthumb.php vulnerability. Many themes (both free and paid) included this handy script and it has resulted in exposing millions of wp installs to easy hacking.

    If you embed plugin functionality in your theme and later that plugin gets an issue fixed, you or whoever else uses the theme will never know.


  3. Andre says:

    This is now become a topic of discussion as I found when I logged into Google+ and can totally relate to this, but also shortcodes is an issue as well. I read an article from Justin Tadlock about this kind of problem and until I read that, it didn’t even think about it. This makes total sense and sites like themeforest.net is a prime example of just how many theme authors there have dug themselves deep with filling their themes with 100’s of shortcodes and plugins. Granted, great flexibility for the end-user….until they switch themes later.

  4. Hillary Bost says:

    You are right I have had so much trouble trying to do that in the past.

  5. CHD says:

    Thanks. This is good and knowledgeable for me.

  6. Paul Weston says:

    Thought this was a great article and very useful for me as I am just about to start using WordPress and designing themes. Love articles like this one because it gives me guide lines into what I should be thinking about when I am approaching my theme design and development.