• Resolved jlebouch76

    (@jlebouch76)


    I’m developing a site using Local by Flywheel and as this is my first time using CPT UI, I made one mistake in planning and naming one CPT (out of 5 i already created). Because of the way i work, i do not have access to PHPmyAdmin and can’t run a query to replace old CPT name to new CPT name. I was wondering if i could rename my CPT (and all the individual SQL files) by editing (Find/Replace) the settings of CPT (from Export), then clearing all my CPT by importing blank, and then importing the modified CPT settings.

    Thanks for your help.

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

    (@tw2113)

    The BenchPresser

    If you go to edit your settings for the specific post type in question, we have a “rename” option in place. It’ll handle the converting of the “post_type” column in the wp_posts table for you. That’s the primary spot to worry about, in terms of the database. Any spots that you specify in your theme files will need to be manually updated.

    As with all database edits, probably best to run a backup before making the edit, just in case, but it should be pretty straightforward and core compatible.

    Thread Starter jlebouch76

    (@jlebouch76)

    Thanks for your quick reply.

    Are you referring to the “migrate posts to newly renamed post type” option visible in the Edit tab of the CPT?
    Will everything work out fine if i change my Post Type slug to new name, its plural and singular label to new name and click on that migrating option?

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Yes, that’s the spot I’m referring to.

    And that’s always the goal/intent. Ultimately it’s just updating a column value for you, but like I said, anything frontend or maybe in custom plugins where you’ve specified the old post type will need to be handled by you, and backups never hurt, just in case

    Thread Starter jlebouch76

    (@jlebouch76)

    Wonderful! I will do my backups before doing this sensitive action.
    Thanks for your great support!! Much appreciated.

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Welcome.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘How to rename CPT’ is closed to new replies.