custom post types - uneditable in dashboard (5 posts)

  1. hafman
    Posted 4 years ago #

    I made a custom post type back when WordPress version 3.1 was the latest. Unfortunately i used camel case for both the post type and the taxonomy.

    In recent versions it seems that camel casing these words is not supported so i am stuck with 397 posts that can't be edited in the back or seen at the front end.

    What are my options apart from copying over all the data into a new post type that follows the rules?

    I looked at the database but i'm not sure i want to get into that!

  2. hafman
    Posted 4 years ago #

    Actually i can't copy anything over as the editing is locked and the content is not viewable, Doh! No choice but to fiddle with the database...... hmmm....

  3. Michael Dance
    Posted 4 years ago #

    First, change the name of the custom post type in your register_post_type function.

    Then, the easiest thing to do is run a database query directly, inside phpMyAdmin or whatever. If your database prefix was wp_, it would look like this:

    UPDATE wp_posts SET post_type = 'new_post_type_name' WHERE post_type = 'oldPostTypeName';

    Back up your database before doing this!

  4. hafman
    Posted 4 years ago #

    I just found this link to stack exchange and tried it, adding a function to functions.php that has successfully renamed the post type. All the links have come back on in the admin. Still nothing out front though.

  5. hafman
    Posted 4 years ago #

    Here is the code i used and i'm trying adapt it to access the wp_term_taxonony table.

    global $wpdb;
    $wpdb->query("UPDATE $wpdb->wp_term_taxonomy SET taxonomy = 'imggallery' WHERE taxonomy = 'imgGallery'");

    Nothing doing yet that i can see in the database

Topic Closed

This topic has been closed to new replies.

About this Topic