Support » Fixing WordPress » How to Change Theme but Keep Taxonomy Information?

  • What happens to my taxonomy information when I change themes? Can I take it with me when I change? Does anybody know how this is done?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi dylan!

    The biggest thing that determines of whether not you can take that information with you when you change theme is if the taxonomies are registered in the theme or a plugin. If they’re in a theme’s functions.php, they’ll “disappear” when you change themes (though data would still be there, just inaccessible, in the database). If you instead do the registration in a custom plugin — I wrote a post that walks through the basics of what a plugin needs to have — you’ll be safe from theme to theme.

    Hope that helps!

    That is helpful, thank you.

    In my old theme, the taxonomies are indeed registered through the theme, via its functions.php file and other related .php files. I’ll use your tutorial and try to move that stuff over into a plugin that I can keep, even if I change themes.

    Is there no plugin already that can detect previously-built taxonomy data?

    That’s a really interesting question.

    I can’t say with certainty — a quick look turned up no such thing — but even if one exists I’d probably recommend against using it. Finding out what taxonomies used to exist isn’t a very performant operation, and you have to register your taxonomies before every page load. So while it’d be convenient the first time, your server would see a big performance hit overall as a result.

    This same basic reason is why I generally avoid any of the numerous taxonomy plugins that exist. Though the fetching of the data the plugin itself stores in the database is more performant that finding unknown old taxonomies in your database, it’s all still slower than something hard-coded into a PHP file like your custom plugin would be.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to Change Theme but Keep Taxonomy Information?’ is closed to new replies.