Editing Custom Post Types

I created a custom post type and added some posts that use
it. Now I want to change the custom post type. Is that safe?
You can return to your functions.php file and edit your custom
post type any time, without causing a problem. For example,
you can change the labels that appear in the dashboard,
the features that your custom post type supports, and the
taxonomies it uses.
You might, for instance, create a custom post type for products
that doesn’t support categories, then add some product posts,
and then decide that you actually do want to use categories. No
problem—just change the code in functions.php. When you go
back and edit one of your product posts, the category-picking
box will magically appear.
If you want to remove a custom post type, you can delete
the block of code that creates it in functions.php. However,
you should delete the posts that use your custom post type
first. Otherwise, those posts will continue to live, zombie-like,
even though you can’t see or manage them in the dashboard.
There’s one detail that you should probably never change once
you create a custom post type: its lowercase name. This is the
detail you supply as the first argument you pass to the register_
post_type() function. If you change the name,
WordPress assumes you removed the old custom post type
and you’re adding a new one. As a result, any posts that use
the old custom post type will disappear from the dashboard,
which obviously isn’t what you want.

Advertisements
Editing Custom Post Types

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s