• Resolved Chabib O.

    (@ochabib)


    Hello,

    I installed CPT UI and I created a Post Type called ”services” and then deleted it (made sure to delete every taxonomies and posts related to it before doing so). However it seems that the post type “services” still exists somewhere.

    Here Elementor still finds the post type (https://ibb.co/9H3j2Hr). I can’t use the slug “services” anymore as it’s still related to a custom post type already deleted

    So here are my questions: Is there a way to totally delete a custom from wordpress post type once created ? and how?

    Thank you

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    You’re saying that you installed CPTUI, created a services post type, and then deleted something. Not sure what you deleted specifically, whether it be the post type setting, or CPTUI the plugin. Does it go away if you for sure deactivate CPTUI?

    Is it possible that the same post type slug is being registered elsewhere? Perhaps in the theme?

    Thread Starter Chabib O.

    (@ochabib)

    Hi I deleted the post type not the plugin..

    And no I don’t think it’s possible, I am using the Hello theme by Elementor. And as you can see on the last screenshot, Elementor keeps recognize the post type “Services”.

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Does the dropdown listing go away when you disable CPTUI from being an active plugin? If no, then the registration is either cached somehow, or it’s coming from a different source in the website. If it does go away, then I’m curious about your CPTUI settings and if there are other post types still registered that maybe still match up somehow to say “service” in this case.

    Thread Starter Chabib O.

    (@ochabib)

    Even after deactivating the plugin the post type “services” doesn’t go away, it’s still listed. No there’s no other post types matching the name. And now since the slug”services” is still somewhere in the website I can’t create anything using the same slug (page etc…).

    “then the registration is either cached somehow, or it’s coming from a different source in the website”

    That’s why I would like to know where (file or database) are the post types created are written. I will check there and make sure there are properly removed

    Thank you

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Noted on the first part. That said, unless it’s a different plugin providing UI for creating post types, there’s no spot in regards to the database that would be registering for you still. Chances are it’s coming from a file **somewhere** that’d got the register_post_type() function used. It could be a file in the mu-functions folder in your wp-content folder, perhaps a different plugin that doesn’t provide a UI, but also uses register_post_type() code itself, or one of any potential files from your active theme. Good first spot to check there would be the functions.php file, but that’s not guaranteed to be the file holding it. Sadly, that’s about as best I can help with tracking this down, as I don’t have any sort of copy of the file system for the install, as I shouldn’t, because it’s not my site 😀

    Thread Starter Chabib O.

    (@ochabib)

    After a thorough review of the code in different files I finally found the register_post_type( 'services', $args ). So after deleting it and all the code related, everything went back to normal.

    Thanks again

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Awesome to hear that you were able to track down the source of the post type.

    Let us know if you need help with anything else.

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

The topic ‘Remove Custom Post Type from WordPress’ is closed to new replies.