Thinking of changing WordPress themes? It’s something just about every WordPress user has done once in their WordPress career.
In a way, it’s theme developers’ fault. They keep putting out so many amazing looking themes - it’s impossible for us not to get theme-envy and want to make a switch!
Plus, WordPress makes it so dang easy to change a WordPress theme. I mean, all you have to do is go to Appearance → Themes, click a button, and your site has a brand new look!
But is that really all there is to changing WordPress themes? I mean, on the surface - yes. That handles the basic mechanics. But there are some important questions you want to consider before, or at least during the process of, changing WordPress themes.
And those issues are what I want to talk about in this post. Considering these questions will hopefully make the transition process smoother and ensure you don’t lose any important functionality in the process.
1. Do You Have Any Important Code Snippets in Functions.php?
Ok, you’re not actually supposed to put theme-independent code snippets in your functions.php file (you’re better off using a custom plugin for that instead).
But...I know it’s something that a ton of WordPress users do anyway. So I’m not going to chide you too much for following the trend. Plus, tons of tutorials just have you add things to functions.php no matter what.
But here’s the thing:
When you switch WordPress themes, all of those code snippets stay attached to your old WordPress theme. As you’d expect, that’s a big problem if those snippets are driving any important functionality on your site.
So, before you switch themes, make sure that you pull out all of those important code snippets and port them over to your new theme. If you haven’t already, now might also be a good time to add code comments to everything so that you (and others) can always remember what each code snippet actually does.
2. Do You Have Custom CSS For Theme-Independent Elements?
Another issue that you might run into is losing any custom CSS you applied to theme-independent elements.
For example, at WPLift we use a custom “visitbutton” class to style CTA buttons inside posts.
If Daan were to go ahead and change themes without considering that “visitbutton” CSS class, every single button that currently shows up inside post content would turn into a regular old link overnight.
So, whether you added your custom CSS to the new Additional CSS tab in the Customizer, right into your theme’s stylesheet, or in your own custom enqueued stylesheet, you need to consider how to bring it over.
Additionally, you also need to think about whether or not those styles need to be updated to match the new theme. For example, a custom button might’ve fit perfectly with the old theme, but that doesn’t mean it’s going to work with the new theme.
3. Did You Add Google Analytics Or Other Tracking to Header.php?
When I tell people how to add Google Analytics to WordPress, I always recommend that they use a plugin because it makes the tracking code theme-independent. But…
Just like with functions.php, this is something that I know a lot of people do. I mean, it’s just so easy to go in, paste the code at the end of header.php, and call it a day.
If that was you, you’ll need to make sure to move your Google Analytics code (or other tracking codes) over to your new theme so that you don’t lose out on any data.
Rather than adding it to the header.php file for your new theme, you can use the free Insert Headers and Footers plugin to insert the tracking codes. That way, you’ll never have to think about moving them over if you switch themes again down the road.
4. Are You Using Any Widgets That Are Theme Specific?
Some themes come bundled with widgets that help you display information in your sidebar or footer. Unfortunately, I have bad news for you if that applies to your theme:
You’re going to lose those widgets as soon as you change WordPress themes.
You can probably find a custom WordPress widget plugin to replace them. But you will need to do just that - replace them.
5. Are You Using Any Shortcodes That Are Theme Specific?
Just like widgets, some themes also give you a bunch of custom shortcodes to help you style your content. That’s great while you’re using the theme...but as soon as you stop using the theme, those shortcodes are going to turn into this:
That’s not very attractive, is it?
Unfortunately, removing old shortcodes is a bit of a pain.
If you didn’t use theme-specific shortcodes very often, your best bet is to go through and manually edit each post to remove the offending shortcode(s).
If the job is too big for manual labor, Inpsyde’s Search & Replace plugin can help you automatically search through every post and remove each shortcode. Basically, you’ll be running a search on the post’s table in your WordPress database to replace instances of your shortcode with blank text or HTML (depending on what the shortcode actually did).
This is not for total beginners or the faint of heart, though. Running operations on your database is an easy way to mess things up if you’re not careful. So, always:
- Back up your database first
- Use the plugin’s Dry Run feature before you make permanent changes
6. Are You Using Theme Post Formats That Are Essential to Your Site?
The third member in the trio of theme-specific styling - if you’re using lots of custom post formats that came included with your current theme, consider what your content will look like without those post formats.
Losing post formats won’t make the post disappear or anything, but it might cause those posts to lose important formatting that’s integral to how your readers experience your content.
This is probably the smallest consideration (in comparison to widgets and shortcodes), though.
7. Does Your New Theme Use Different Image Sizes?
There’s a good chance that your new theme uses different image sizes, especially for featured images...which might make your existing images unoptimised.
Thankfully, this one is super easy to fix - just use the free Regenerate Thumbnails plugin to...regenerate your image uploads’ thumbnails according to the sizes for your new theme.
Make Your WordPress Theme Change a Success
Changing your WordPress theme is always exciting. Just make sure you consider all of the points above before making the switch so you don’t lose essential functionality or formatting.
Once you make the switch, you’ll also want to go through and thoroughly test things like:
- 404 pages
- Contact forms
- Important plugin functionality
Now over to you - do you have any other tips for what to consider when changing WordPress themes? Let us know in the comments, please!