3 Definite Ways to Avoid Theme-Lock
I recently wrote about how WordPress users should avoid using theme-specific shortcodes because they create a theme-lockin effect that can be disastrous in the future if the user goes to switch themes. While theme-lock is not a difficult concept to understand, it is certainly a major issue and must be addressed for new and inexperienced users.
What is WordPress Theme-Lock?
Any inexperienced WordPress user who’s changed themes probably knows the symptoms of theme-lock. Before, you found a theme that seems totally awesome because it had tons of design features and a bunch of shortcodes that would allow you to do some really cool stuff. Then, for whatever reason, you decided to switch to a new theme. Maybe you like the design better, it offers some better features, etc. Whatever the reason, you uploaded the new theme, activated it, played with some of the settings, and voila! Finally, you go to preview your new theme on your site and it’s totally screwed up. You find a bunch of shortcodes scattered throughout your content that now don’t render what they used to, your custom content (i.e. Portfolio Items, etc.) has disappeared and your site is trashed because of it. This is a result of switching to a new theme when most of your website relied on the previous theme. You now realize that it may be easier to just switch back to your old theme rather than going through all of your pages and posts to switch/remove shortcodes, re-add your custom post types, etc. This, folks, is theme-lock.
How to Avoid Theme-Lock
I’m now going to give you a 3-point list of how to completely avoid theme-lock. This list gives you three methods to prevent the headache of theme-lock in the future.
Stop Using Functionality-Heavy Themes
Using a theme that comes with a ton of functionality is not a good decision. I totally understand that these types of themes sound great to non-technical users and seem to provide a great value. Themeforest has made a killing on these types of themes. However, they comprise the problem that is theme-lock. Eliminate the source by using a clean theme such as the Genesis Framework. Since Genesis doesn’t come with built-in custom post types or shortcodes (well, it has a few very useful ones), you are forced to use these things by means of a plugin. Putting these things in a plugin makes them portable and theme-independent (see below).
Learn Some HTML/CSS
By learning even the basics of HTML and CSS, you will be able to control the appearance and layout of your website much more than you thought was imaginable. You DO NOT need to be an expert programmer or even know any PHP to learn a bit of HTML and CSS. Check out w3schools for some excellent, free content or Treehouse if you want some high-quality, premium videos that test your knowledge. You should at least be familiar with basic HTML markup, creating and styling classes, and using basic CSS.
Keep All Functionality Theme-Independent
Plugins are for functionality, themes are for display. Live by that bit of knowledge when working with WordPress because it will make your life easier. To ensure that you never break this rule, ask yourself one simple question when you add something to your WordPress website: Do I want this to remain intact if I switch themes? If the answer is yes, then you need to be using a plugin.
So what plugins should you be using to move your site’s functionality away from themes? I’ve put together a list of plugins that do things commonly found in functionality-heavy themes. These plugins will let you rest easy knowing that your important functions and customizations move with you when you switch themes.
- Custom Post Types UI & Advanced Custom Fields – These two plugins are two of my all-time favorite plugins for WordPress. Custom Post Types UI lets users easily and quickly create unlimited custom post types without needing to mess around with PHP. Advanced Custom Fields lets you create unlimited custom fields for your WordPress posts. Together, these two plugins create a real powerhouse setup for creating any type of custom content.
- Essential Grid – This plugin is the best available for creating content grids. Content well suited for grids include portfolio items, blog posts, testimonials, products, galleries, and more. You can use it together with CPT UI and ACF to display your custom content in very elegant even-grid or masonry layouts. Essential Grid is flat-out amazing!
- Shortcodes UI – This free plugin lets users create their own shortcodes without needing to use PHP. If you have a lot of repetitive content, shortcodes are great to store it in. Why? If you ever need to make changes to that content (i.e. to change a price), you can make the change in one location (the shortcode) rather than in however many places that content is located. You can customize the HTML to your liking and store it in a simple shortcode that you can insert into any post. Although I hate theme-specific shortcodes, I’m not opposed to shortcodes in general because they can be great for things like this.
- Shortcodes Plugins – If you need to use design shortcodes to improve the experience for your site’s viewers, use a plugin. Although design shortcodes are more often seen in themes, there are plugins that give users a nice selection of shortcodes to enhance their website’s design. Here’s a good article listing some of the best free shortcodes plugins for WordPress.
Conclusion
There you go! You should now have a very good understanding of what WordPress theme-lock is and how to prevent it moving forward. If you have any questions, feel free to leave a comment below. Thanks for reading!
David says
Thank you for this article. I helped me to shed some light on what I already thought was true. I’m going to take your recommendation and check out Genesis framework.
Ren says
Hey, David. Glad I could help out, and I hope you like Genesis!
Ryan says
Nice article Ren. I read an article from Chris Lema re: being “locked in” when you choose Divi. I’ve never used Divi, but I’m considering X Theme. Both are on Themeforest as you know and we are on the same page when it comes to TF. Aside from that, do you know if transferring away from X Theme is as messy as doing so with Divi?
Thank you,
Ryan
Ren says
Personally, I would never use X because that’s the “poster-child” for bloated themes – it includes 12 premium plugins alone! I don’t follow products on TF anymore, but I don’t recall seeing a commercial theme with more bloat than X. Occasionally, I’ll use Divi if the situation calls for it, otherwise I use Genesis 99% of the time.
That said, I’m not sure how X modifies content, and what it leaves behind when it’s deactivated, so I can’t give you an honest answer on that. I know it requires the use of a lot of shortcodes, which will be left behind any time they’re attached to a deactivated theme. Shortcodes are where most bloated themes really leave their mark, in addition to increasing the size of the database with options, post meta, etc. Ultimately, both of those themes are going to create some amount of theme-lock. The difficulty of cleaning up the front-end (not including the database) after a switch depends on the amount of content you have, and how much of it has been marked up with shortcodes.