Want to hear the short version first? Here it is (again): don’t let your WordPress theme handle portfolio, or any other functionality. Imagine that sentence is bold, underlined and blinking at the same time, so it’s easier to memorize. Now read on to see how you can recover your lost content before Google bots hit your site again.
I already covered why you should use a plugin for your WordPress website’s portfolio, so if you’re still not in trouble or need convincing, please read that post first. But what if you already created portfolio using custom post types registered by your theme, switched to another theme and poof – it’s all gone?
Recovering is easier than you thought, but requires some work. Please keep in mind this is just one of many ways to handle this. You can always hire a developer to do it, but there’s a great chance you can do it yourself without ever seeing a line of code.
Step 1 – Temporarily Reactivate Your Old Theme
This will make all the custom posts registered by the old theme re-appear. Now that you know they were only invisible and not deleted, move on to:
Step 1.b – promise you’ll never let a theme handle plugin’s job again
Step 2 – Select a Portfolio Plugin
You’re in luck, there’s lots of them available. If you want to use a free one, just search WordPress.org plugin repository for term “portfolio”. If you don’t mind paying, CodeCanyon has many portfolio plugins as well. And if you don’t mind waiting for a few weeks, we’re working on a free one as well. Dragan will announce the hell out of it as soon it’s released so if you’re interested it might be best to subscribe to our mailing list.
Step 3 – Copy All Theme Portfolio Projects to Plugin Portfolio Section, One by One
This is the roll up your sleeves and do the work part, but if you want to make sure it’s done properly doing it manually is the only way. For each project you had in portfolio section added by your theme create a matching one in portfolio section added by plugin you chose. Title, content, project details, featured image, copy everything.
Step 4 – Redirect all URLs
It’s unlikely that “Project A Added by Theme” and “Project A Added by Plugin” URLs will match, so you’ll need to set up redirects for each project added by theme’s portfolio to matching one added by plugin. You can use Redirection plugin to do this.
Step 5 – Activate New Theme Again, Make Sure Everything Works, Repeat Step 1.b
After you’ve re-activated your new theme, made sure all redirects work and everything looks ok, make sure you never, ever let a theme handle what it wasn’t supposed to, so you don’t get in trouble again.
The whole idea with public themes is that you can interchange them without having to jump through extra hoops. “Plugin territory” features are what makes this impossible. In WordPress Theme Review Guidelines there’s a page that lists everything that’s considered plugin territory and should never be part of a theme. You’ll never find any of that in free themes you can download from WordPress.org theme repository.
Themes you can find elsewhere are a different story. Features bundled into one theme will either not exist or be done in a different way in another. That’s why being aware of and following WordPress best practices is a good thing for users, not just developers. Knowing what can get you in trouble is a great way to stay out of trouble. If a theme does anything other than allow your content to shine, it’s trying to do what it’s not supposed to.