Are custom post types lost when the theme is changed?

I am about to begin work on a custom WordPress theme and I want to know how careful I have to be about custom posts. Suppose I create a WordPress theme that registers several custom post types. To my understanding this happens upon activation of the theme.

If I were to create several posts of this custom type and then change to a theme that does not have that custom post type would I have lost the posts completely?

What if I changed to another theme that DID have the same custom post type (if that is possible) would they still exist?

Further, what about these same issues in connection with custom taxonomy? If I change to a different theme that does not support the custom taxonomy will the taxonomy data from custom posts be lost (if they are even saved). Will the data for the custom taxonomy still exist?

4 s
4

You don’t lose anything. All your custom posts, taxonomies, terms and their relationships are still in the database. Without having those registered, however, the data can’t be accessed, as in the WordPress edit page or custom queries and the like.

Leave a Comment