Revision 292 is a pre-publication revision. (Viewing current revision instead.)

Renaming WordPress Custom Post Types and Taxonomies

Taken from this Stack Exchange Thread: http://wordpress.stackexchange.com/questions/1037/renaming-custom-post-types-and-taxonomies SQL query for renaming the posts: [js]UPDATE `wp_posts` SET `post_type` = '<new post type name>' WHERE `post_type` = '<old post type name>';[/js] SQL query for renaming taxonomy: [js]UPDATE  `wp_term_taxonomy` SET  `taxonomy` =  '&lt;new taxonomy name&gt;' WHERE  `taxonomy` = '&lt;old taxonomy name&gt;';[/js] That should take care of all of the database areas. Just remember to match the new names in the code where the post types or taxonomies are registered. As far as I know, this is not handled in any plugins yet.

Revisions

  • October 18, 2012 @ 05:48:30 [Current Revision] by PeterLugg
  • October 18, 2012 @ 05:47:53 by PeterLugg
  • October 18, 2012 @ 05:46:17 by PeterLugg

Revision Differences

October 18, 2012 @ 05:46:17Current Revision
Content
 Added: Taken from this Stack Exchange Thread: <a href="http:// wordpress.stackexchange.com/ questions/1037/ renaming-custom- post-types-and-taxonomies" target="_blank" >http://wordpress.stackexchange.com/ questions/1037/ renaming-custom- post-types-and- taxonomies</a>
 Added: SQL query for renaming the posts:
 Added: [js]UPDATE `wp_posts` SET `post_type` = '&lt;new post type name&gt;' WHERE `post_type` = '&lt;old post type name&gt;';[/js]
Deleted: Added: SQL query for renaming taxonomy:
 Added: [js]UPDATE  `wp_term_taxonomy` SET  `taxonomy` =  '&amp;lt;new taxonomy name&amp;gt;' WHERE  `taxonomy` = '&amp;lt;old taxonomy name&amp;gt;';[/js]
 Added: That should take care of all of the database areas. Just remember to match the new names in the code where the post types or taxonomies are registered. As far as I know, this is not handled in any plugins yet.

Note: Spaces may be added to comparison text to allow better line wrapping.

Tags: , ,

No comments yet.

Leave a Reply