Is it possible to add a link category on plugin activation?

What I mean is the Links section, as you know by default it has the Blogroll link category. I want to add a new link category when my plugin is activated, is there a quick and easy way to do this? What is the best method to use?


1 Answer 1


Link category is a simple taxonomy just like categories , named: link_category so to add one you can use wp_insert_term() eg:

  'My link category', // the term 
  'link_category', // the taxonomy
    'description'=> 'this is a description.',
    'slug' => 'my-link-category'

and to make all this happen on plugin activation take a look at register_activation_hook

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.