WordPress.org

Forums

Custom Post Type UI
[resolved] "Trash" feature to protect against accidental deletion? (4 posts)

  1. exius
    Member
    Posted 2 years ago #

    I love this plugin and have been using it in a few of my sites... but just now I accidentally deleted a custom post type within "Manage Post Types", and a hundred custom field input values (collected with Advanced Custom Fields) have been lost. The purpose of using Custom Post Types UI was for me to build a database of events, settings, and people, but if I can easily and accidentally delete it with 1 click, it gets me scared that I could lose years worth of data in a split second.

    So this begs the question, how would I be able to recover lost data after deleting a custom post type, and are there any future plans to replace "delete" with "trash" for protection against accidental deletion?

    Thanks again for this awesome product!

    http://wordpress.org/extend/plugins/custom-post-type-ui/

  2. Michael Beckwith
    Member
    Plugin Author

    Posted 2 years ago #

    Hi Exius. Sorry for the long delay when in a small bit of a crisis that you're in.

    I have good news for you. The plugin doesn't actually touch the post type content in your database. All it does is use the register_post_type() function with the arguments you provide for it via the UI portion. So your data is safe and nothing is deleted. All that you'll need to do is set up the settings again for the CPT you want. The only *key* factor you need to for sure replicate is the slug you use. That's the part you enter for "Post Type Name" in the add/editor screen. After you've re-set everything, it should all click again and your content available to display.

  3. exius
    Member
    Posted 2 years ago #

    Hi Michael,

    Thanks for the reply!

    Shortly after the disaster, I took at look at the database and everything still exists as you've mentioned. I had already create another custom post type with a different name and slug (not knowing the slug played a key factor).

    Fixing it the long way... In MySQL, I located my original post (or entry within deleted custom post type events) under wp_posts table and changed the my post's post_type field to the new slug camps.

    It's essentially the same fix, but yours would have been faster! Hope someone will find this information useful :)

  4. Michael Beckwith
    Member
    Plugin Author

    Posted 2 years ago #

    Awesome to hear you found your way nonetheless. Happy WordPressing :D

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Custom Post Type UI
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags

No tags yet.