Change post type name in WordPress easily and without plugin.

How To Change Post Type Name?

We will change post type name in WordPress SQL easily and custom post type is support.

Copy “Change Post Type Name Function” code and paste it in your functions.php file.

Change Post Type Name Function

// Change Post Type Name Function
function WPTime_change_post_type($id, $new_name){
global $wpdb;
$wpdb->query(" UPDATE $wpdb->posts SET post_type = '$new_name' WHERE ID = $id ");
}

Parameter

Parameter $id this for post ID, enter post ID number, for example: 999.
Parameter $new_name this for post type name, enter the new post type name, for example: movies.

Example

If you have post type “page” with ID number “999” and you want to convert this “page” to post type “movies”,
now usage will be like this: WPTime_change_post_type(999, ‘movies’);

Usage

Just paste this line in your functions.php file after “Change Post Type Name Function”:

WPTime_change_post_type(999, 'movies'); // if post type name has been changed, remove this line!

change post type name in wordpress

Now your “page” with ID “999” will be post type “movies”.

Note

Don’t forget, if post type name has been changed, remove usage function “WPTime_change_post_type(999, ‘movies’);” from your functions.php file and you can using it again if you want to change another post type name.