How to update terms into database from specific taxonomy without plugin?

by Muddasir   Last Updated October 28, 2017 22:08 PM

I am trying to update terms order in database

TERMS TABLE enter image description here

TERM TAXONOMY TABLE enter image description here

TERM RELATIONSHIPS TABLE enter image description here

I want to sort order like highlight numbers. I am trying this query but not works for me.

global $wpdb;
$wpdb->query("UPDATE wpl_term_relationships SET term_order=$counter WHERE term_taxonomy_id IN (SELECT term_taxonomy_id FROM `wpl_term_taxonomy` WHERE taxonomy = 'product_tag') ");


Related Questions


Why does wp_remove_object_terms not work?

Updated April 01, 2018 06:08 AM


Removing a taxonomy term

Updated April 04, 2017 08:08 AM


Merging custom taxonomies and removing duplicates

Updated November 09, 2017 15:08 PM