2 Comments
  1. Code?

    $categories = array(‘Category 1’, ‘Category 2’, ‘Category 3’);

    foreach ($categories as $category_name) {
    if (!term_exists($category_name, ‘category’)) {
    $args = array(
    ‘description’ => ‘Description for ‘ . $category_name, // Optional.
    ‘slug’ => sanitize_title($category_name) // Optional.
    );

    // Insert category.
    wp_insert_term($category_name, ‘category’, $args);
    }
    }

  2. Why would you need to create them in bulk? Categories are useless without having posts attached to them.

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer