Unregister Custom Post Type

Sometimes I create a custom post type and decide that I want to change the name after it’s already been created. Unfortunately, it’s not as simple as just going into the functions file and renaming, as that will just create another custom post type. So, instead, you need to unregister your initial post type and then create a new on with your desired name, slug, etc.

Fortunately, unregistering is super simple. Just put this code in your functions file (and delete your “incorrect” and/or “old” custom post type code):

add_action( 'init', 'undo_custom_post_type' );
function undo_custom_post_type() {
    remove_action('init', 'PUT YOUR CUSTOM POST TYPE NAME HERE');
}

cw-index-1-r2
goUSF-index-1
usfgm-index-1-r3
bgl-index-1
ucon-index-1-r1
adopt-index-2
skalet-index-1-r2
pcabral
th-index-1
rms-index-2
km-index-1-r1
peu-index-2-r3b
pdu-index-1-r2a
oph-index-1-r2
mmm-index-1
long-index-1-r1a
ernies-index-1
cooks-index-1-r2a
df-index-1-r1
vs-index-1
uni-index-1
pe-wedding-print
Screen shot 2013-10-25 at 3.38.39 PM
fred
cabral
dava
psa
errg
apex
pag
cwb
beginners
awakealive
ecom
ab