Viewing 1 replies (of 1 total)
  • Dear Fobstar

    We do not delete terms, only definition of taxonomy.

    You can add use this code to delete all entries. Please change country to your taxonomy slug.

    If script stop working because of time try create CLI script and call this function (CLI do not have time or memory limit).

    add_action('wp_footer', 'my_delete_taxonomy_entries');
    function my_delete_taxonomy_entries()
    {
        $taxonomy = 'country';
        $taxonomies = array($taxonomy);
        $args = array(
            'hide_empty' => false,
            'fields' => 'ids',
        );
        $terms = get_terms( $taxonomies, $args );
        foreach( $terms as $term_id ) {
            wp_delete_term($term_id, $taxonomy);
        }
    }

    Marcin

Viewing 1 replies (of 1 total)
  • The topic ‘Custom Taxonomy Remove’ is closed to new replies.