Change name of custom post type after using it

I want to change the name of a custom post type after I’m using it for a long time.

The current name is registered like this:

Read More

register_post_type( 'toremove-name' , $args );

And I want it this way:

register_post_type( 'name' , $args );

If I change it, I think it will make problems in the DB.
Is there a way or a plugin to solve this?

Related posts

Leave a Reply

1 comment

  1. I’m sure there is a plugin, but if you have MySQL access, you can also just rename the CPT the way you have indicated and perform am SQL query to update:

    UPDATE wp_posts SET post_type = New CPT Name WHERE post_type = Old CPT Name;

    Also, don’t forget your taxonomies if you have any registered to the CPT. You might have to flush your permalinks after you performed this action