WordPress.org

Ready to get started?Download WordPress

Forums

Remove custom taxonomy from database (3 posts)

  1. jef3000
    Member
    Posted 1 year ago #

    I have some custom taxonomy created, but would now like to completely (also from the database) remove the taxonomy. Does anyone know a proper way to handle this or knows a query to clean the database?

    Example code:

    register_taxonomy(
    		'xbox360',
    		array('post', 'con_game_reviews', 'con_game_previews', 'games'),
    		array(
    			'hierarchical' => false,
    			'label' => 'games - Xbox 360',
    			'query_var' => true,
    			'rewrite' => array('slug' => 'xbox360')
    		)
    	);
  2. Mike Stumpf
    Member
    Posted 10 months ago #

    I have the same problem. This is the closest that I have found to doing what you are talking about but I am not sure it is actually incorporated in the WP core yet.

    http://core.trac.wordpress.org/ticket/12629

    Cheers

  3. Andrew Tegenkamp
    Member
    Posted 5 months ago #

    I deleted all the taxonomy entries and that seems to clean up the wp_term_taxonomy and wp_terms database tables. That action should remove the references in the database and reset any posts or pages (or custom post types) to not have those associations anymore.

    I believe you can do it in code with wp_delete_term (http://codex.wordpress.org/Function_Reference/wp_delete_term) as well. I think that is the best you can cleanup a taxonomy at this time.

Topic Closed

This topic has been closed to new replies.

About this Topic