I have more than 15 Category ,

And i have a custom taxonomy "classroom",

Is there any way to Create those categories automatically when i activate plugin?

1 Answer 1


When the plugin is activated, you can activate the custom taxonomy creation code.

You can create a scenario like this.

Plugin activated - Custom Taxonomy created - Category information is imported via the xml file you created before

You can export your taxonomy data (Tools - Export) and u have xml file.

And than follow this import code


  • That's what OP wants to do I think yes. Does code to import categories from XML already exist? How do you call it? What specifically do you hook it to?
    – Rup
    Oct 10, 2022 at 10:57
  • can you edit your original answer and delete this one, or vice versa? This isn't a discussion forum thread so these aren't replies, and they will change order based on votes. Your solution should be a singular self contained solution/answer, not a reply
    – Tom J Nowell
    Oct 10, 2022 at 11:26
  • I've deleted your other answer and edited it on to the end of this one, if you have more to add you should use the Edit link to update it
    – Tom J Nowell
    Oct 10, 2022 at 11:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.