Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

is there option to create category with custom id like custom post id is created using parameter import_id ?

$post = array( 'post_title'=>'whatever', 'post_content'=>'whatever', 'import_id'=>123 ); wp_insert_post($post);

what i want to do is create custom post type ( will import data from table which have category id attached ) using wp_insert_post

so i want to create categories with custom id that are attached to products table

right now i'm using custom field added to categories as OLD_CATEGORY_ID and get posts against this custom field id

categories are also imported to wordpress

or is there another better way ?

or this is the ONLY way ? :)

share|improve this question
is my question is too difficult for experts ? or it is not clear ? :) –  Yasir Jul 7 '14 at 15:45

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.