Title: Accidentally Deleted Post Type
Last modified: September 1, 2016

---

# Accidentally Deleted Post Type

 *  Resolved [stuartborders](https://wordpress.org/support/users/stuartborders/)
 * (@stuartborders)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/accidentally-deleted-post-type/)
 * While trying to update a setting for my CPT, I clicked the Delete button. It 
   didn’t prompt me “if I was sure” and was gone before I even realized I miss clicked.
   I know the data is still there, but how to I turn it back on?
 * [https://wordpress.org/plugins/custom-post-type-ui/](https://wordpress.org/plugins/custom-post-type-ui/)

Viewing 11 replies - 1 through 11 (of 11 total)

 *  Plugin Contributor [Michael Beckwith](https://wordpress.org/support/users/tw2113/)
 * (@tw2113)
 * The BenchPresser
 * [10 years, 1 month ago](https://wordpress.org/support/topic/accidentally-deleted-post-type/#post-7523147)
 * Unless you have js console errors going on or js disabled, it should have prompted
   you if you wanted to for sure.
 * That said, best I can offer is fetching the CPTUI saved values from a backup(
   it’ll be in the wp_options table) or simply recreate the settings from memory.
   You’re right that the posts for the post type aren’t deleted at all. We leave
   that up to the user to handle.
 *  Thread Starter [stuartborders](https://wordpress.org/support/users/stuartborders/)
 * (@stuartborders)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/accidentally-deleted-post-type/#post-7523215)
 * I don’t have any JS errors, double checked.
 * Im looking in the wp_options table for my other post type to recreate the lost
   one from, but can’t locate values for it there. All I can find are widgets I 
   have setup for the sidebar I am using on the archive for that post type. What
   should I be looking for if my “still live” post type name is Recipes?
 *  Thread Starter [stuartborders](https://wordpress.org/support/users/stuartborders/)
 * (@stuartborders)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/accidentally-deleted-post-type/#post-7523216)
 * I wasn’t super far into it, only a few posts. So what could I do to delete any
   information that would allow me to remake the slug “Press”? Would the old posts
   then show up if I rebuilt the post type in the UI with the same name/values? 
   even if they wouldn’t I want to use that slug. Can I do that?
 *  Plugin Contributor [Michael Beckwith](https://wordpress.org/support/users/tw2113/)
 * (@tw2113)
 * The BenchPresser
 * [10 years, 1 month ago](https://wordpress.org/support/topic/accidentally-deleted-post-type/#post-7523244)
 * We store the plugin’s settings in option keys of `cptui_post_types` and `cptui_taxonomies`
   if I recall right, Both are arrays of post types or taxonomies registered, with
   the post type slug being a key and the value being all the settings chosen for
   that type or tax. All of the actual content created for them are stored in their
   appropriate tables just like posts and pages and post types not registered through
   us.
 * So if you were planning to get the post type back via a backup of the database,
   you’d want to check the backup’s wp_options table and locate that option key.
 * If you’re going the route of rebuilding, since you say you weren’t that far along,
   re-using the same slug would once again register a post type with that one, and
   all of the posts would once again be associated with it. Only thing you’d need
   to consider is any settings for the post type that you intently set, as opposed
   to perhaps relying on defaults. Biggest ones I can think of would be like hierarchical
   for parent/child relationships or has archives, or public in general.
 * Long story short regarding rebuilding, it should be really easy to get back up
   and going. As easy as just using the previous slug again.
 *  Thread Starter [stuartborders](https://wordpress.org/support/users/stuartborders/)
 * (@stuartborders)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/accidentally-deleted-post-type/#post-7523288)
 * When i try to enter it again it says the slug already exists. Where do I need
   to edit the database to clear up the slug, so i can recreate it. Really the only
   thing custom other than the slug and the two labels was the icon. So it should
   be super easy to rebuild. Just the UI won’t let me because it shows the slug 
   still taken.
 *  Thread Starter [stuartborders](https://wordpress.org/support/users/stuartborders/)
 * (@stuartborders)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/accidentally-deleted-post-type/#post-7523289)
 * thanks for all of the help by the way!
 *  Plugin Contributor [Michael Beckwith](https://wordpress.org/support/users/tw2113/)
 * (@tw2113)
 * The BenchPresser
 * [10 years, 1 month ago](https://wordpress.org/support/topic/accidentally-deleted-post-type/#post-7523292)
 * If it’s giving you that error, then it’s still either present in the CPTUI settings,
   or is somehow registered somewhere else in the execution of the loading of the
   site.
 * Did you maybe register it via functions.php to do some testing for something?
 * The import/export area would provide some information of what’s stored in the
   settings at the present moment as well.
 *  Thread Starter [stuartborders](https://wordpress.org/support/users/stuartborders/)
 * (@stuartborders)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/accidentally-deleted-post-type/#post-7523316)
 * I didn’t register it anywhere else except through CPTUI. It was there and working
   great till I clicked delete.
 * Ok So in the export feature I just see the other post type, Recipes. Can I copy
   this, duplicate it and change the name values to Press rather than Recipes? Does
   a comma separate theme? {“recipes”: {settings data}, “press”:{settings data}}
   like that?
 *  Plugin Contributor [Michael Beckwith](https://wordpress.org/support/users/tw2113/)
 * (@tw2113)
 * The BenchPresser
 * [10 years, 1 month ago](https://wordpress.org/support/topic/accidentally-deleted-post-type/#post-7523319)
 * Yes, that looks correct.
 * Still not sure why it’s giving you the duplicate slug error at this point, unless
   some other plugin is registering the same slug and you’re simply not aware of
   it.
 *  Thread Starter [stuartborders](https://wordpress.org/support/users/stuartborders/)
 * (@stuartborders)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/accidentally-deleted-post-type/#post-7523332)
 * YEAH! that worked. It was weird. After the import, it saw it as an option in 
   the “Edit” area, but the fields were blank. So I added them back as they were
   before (and in the array) and clicked Save. Everything was there and ready!
 * Thank you SOOOOO much for the support! I really appreciate it.
 *  Plugin Contributor [Michael Beckwith](https://wordpress.org/support/users/tw2113/)
 * (@tw2113)
 * The BenchPresser
 * [10 years, 1 month ago](https://wordpress.org/support/topic/accidentally-deleted-post-type/#post-7523333)
 * Very odd, but glad o hear things are worked out in the end.
 * Have a good rest of the day Stuart.

Viewing 11 replies - 1 through 11 (of 11 total)

The topic ‘Accidentally Deleted Post Type’ is closed to new replies.

 * ![](https://ps.w.org/custom-post-type-ui/assets/icon-256x256.png?rev=2744389)
 * [Custom Post Type UI](https://wordpress.org/plugins/custom-post-type-ui/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/custom-post-type-ui/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/custom-post-type-ui/)
 * [Active Topics](https://wordpress.org/support/plugin/custom-post-type-ui/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/custom-post-type-ui/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/custom-post-type-ui/reviews/)

 * 11 replies
 * 2 participants
 * Last reply from: [Michael Beckwith](https://wordpress.org/support/users/tw2113/)
 * Last activity: [10 years, 1 month ago](https://wordpress.org/support/topic/accidentally-deleted-post-type/#post-7523333)
 * Status: resolved