• Resolved elemenope

    (@elemenope)


    After renaming my custom post type, I can’t display my 25 German and 25 English custom posts anymore and I lost WPML functionality.

    How can I solve this? Go to the previous name didn’t work. I have now three different custom post types and would like to delete two of them without loosing my 50 custom posts.

    How can I do that?

    https://ww.wp.xz.cn/plugins/custom-post-type-ui/

Viewing 15 replies - 1 through 15 (of 33 total)
  • Thread Starter elemenope

    (@elemenope)

    Ok, I could set it back and I have now only one custom post type.

    But the custom posts are still not displayed. Could you help me?

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    After renaming my custom post type, I can’t display my 25 German and 25 English custom posts anymore and I lost WPML functionality.
    Chances are both spots are using the original slug, and would need to be updated use the newly renamed one.

    Deleting the post types in CPTUI settings won’t delete your content, so you’re safe there. We proactively choose not to delete content outside of just our settings.

    Did you return to the original slug before you renamed anything? Or is it the new one you intend to use? If the new, intended ones, then you’ll need to find a way to get the original post type slugs for those posts switched to the the new one. Possible you could rename the post type in your settings to the original slug, and get them back to listed, before re-renaming and using the checkbox provided to migrate posts between post types.

    I hope this is making sense, but please let me know of any questions you have before acting, so I can help make things as smooth as possible.

    Thread Starter elemenope

    (@elemenope)

    Hi Michael

    I could Import the settings from my inquiry six month ago. I had then the same problem with multiple custom post types. Since then I didn’t change anything on the settings. As far as I understand, the custom posts should be displayed now.

    But there is nothing displayed… What else can I do?

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    To clarify, where are they not showing? Frontend? WP admin? If they’re showing just fine in the admin area, then things are covered on that part, and the post type registered appropriately. If they’re not showing on the frontend, then chances are there’s a custom query being made somewhere that is not using the correct parameters to find the post type like needed.

    One of the “hazards” involved with renaming post types, you have to check all areas of the website for what may be using them and where, and update them appropriately. Not something we’re able to control via our plugin.

    Thread Starter elemenope

    (@elemenope)

    They are not showing in the backend, CPT UI. They are not listed on the left side under “showing Bildbeiträge”.

    In the frontend, I can find it, but that’s really odd. It’s double displayed at

    http://www.mywebsite.com/portfolio/name/name

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Would you be willing to let me into the admin area and poke around first hand? I’m getting curious what’s going on.

    Also the original slug being used would be helpful.

    Some thoughts, after your last post, is possibly usage of characters like “ä” and others with various types of accents may be playing a part in this.

    Thread Starter elemenope

    (@elemenope)

    Oh yes, that would be fine. I’m curious too.

    Where to transmit the Login Details?

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    set up a temporary admin user with a username of your choice and michael @ webdevstudios . com for the email. I’ll set the password later on

    Thread Starter elemenope

    (@elemenope)

    Ok! Set up.

    Thread Starter elemenope

    (@elemenope)

    Ok, I did it.

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Looks like I’m an editor, and need to be an administrator, to be able to access the settings for CPTUI.

    Thread Starter elemenope

    (@elemenope)

    Updated to Admin.

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Alright, I’m not able to save the file myself, but I believe I have pinpointed the issue.

    I was able to successfully see the listing myself on my own dev site, using your settings.

    However, I noticed some usage of the pre_get_posts hook in your child theme’s functions.php file, and that would actually have an effect on the admin.

    I recommend amending that to the following:

    function add_custom_types_to_tax( $query ) {
        if ( is_admin() ) {
            return;
        }
        if( is_tag() && empty( $query->query_vars['suppress_filters'] ) ) {
    
            // Get all your post types
            $post_types = array( 'post', 'portfolio' );
    
            $query->set( 'post_type', $post_types );
            return $query;
        }
    }
    add_filter( 'pre_get_posts', 'add_custom_types_to_tax' );

    Notice that I added this to the top, which prevents it from running in your WP admin area.

    if ( is_admin() ) {
        return;
    }

    Try it out and let me know if that fixes all the remaining issues.

    Thread Starter elemenope

    (@elemenope)

    Thank you for your help!

    I amended the child theme functions.php to this code as described. Wihout success. The Custom posts aren’t still listed.

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Will go back in and re-check some things shortly

Viewing 15 replies - 1 through 15 (of 33 total)

The topic ‘How to remove custom post types?’ is closed to new replies.