How to fix tag group from being “not assigned” by SQL query.
-
I upgraded this plugin from v.1.22.0 to latest (v.1.44.1) and all the tag’s group became “not assigned”, and confirmed if I downgrade the version to 1.22.0 it still shows the correct number of tags in groups.
(I’ve known that upgrading above v.1.22.x causes this since about 2 years ago.)After I read following topic, I did some workaround like Troubleshooting > Migrate / Maintenance.
this threadFirstly, the workaround did not make any change, but afterwards some tags became to be in correct group (I don’t know what was effective for that), but some still remains in “not assigned”.
Since I want to find stable and fast way to migrate the tag group (it is important when I migrate data onto the production environment), I look into SQL query when assigning the tag group via posts > tags, and found the following query is a trick.
INSERT INTO wp_termmeta (term_id, meta_key, meta_value) VALUES(<TERM_ID>, '_cm_term_group_array', ',<TERM_GROUP_ID>,');
I think the below query running simultaneously with above UPDATE query is not neccessary since I don’t update the “description” nor “parent”.
`UPDATE wp_term_taxonomy SET term_id=<TERM_ID>, taxonomy=’post_tag’, ‘descriptin=”, parent=<PARENT_ID> WHERE term_taxonomy_id=<TERM_TAXONOMY_ID>;So, I created multiple “INSERT INTO wp_termmeta ….” queries corresponding to the tags which is not assosiated to the correct group.
After running the queries, the list in Tag Groups > Home still did not change at all (i.e. the number of the tags in corresponding group was not correct), but the group in posts > tag shows the correct group.I did Troubleshooting > Migrate / Maintenance / reset tag filter, but did not get changed anything.
I finally ended up to do the bulk edit tags via posts > tag, and this works perfectlly (i.e. list in Tag Groups > Home shows correct numbers of tags in each group).Even the bulk edit works, I want to avoid to change the tags group manually when I do the production-migration since I have about 100 tags to change the group.
So, if possible, could you tell me what I’m missing on changing the tag groups via above SQL query?Thanks,
- The topic ‘How to fix tag group from being “not assigned” by SQL query.’ is closed to new replies.