Delete all tags where tags_count = n

skypeleft

Active member
Aug 10, 2019
401
71
28
Hi guys, I want to delete all tags where count = 1, because my database much more tags record in my database, phpadmin
Can you give me a SQL query to do that?. I don't see a tag table... my WordPress website
Thanks.
 

zzn

Member
Banned User
Jul 27, 2022
89
8
8
I strongly recommend you don't try to approach this the way you are thinking. Terms and taxonomy in WordPress could be relatively complex and you could end up creating a bunch of issues for yourself by directly trying to use SQL for this.
 

zzn

Member
Banned User
Jul 27, 2022
89
8
8
Direct SQL queries are notorious for leaving behind orphaned artifacts when used for stuff like this.
 

zzn

Member
Banned User
Jul 27, 2022
89
8
8
While I don't have a solution for you exactly, I suggest you look into WordPress hooks and filters (or those of WooCommerce if you're using it) for this purpose instead.
 

zzn

Member
Banned User
Jul 27, 2022
89
8
8
I have this exact issue in my to do list for one WordPress website.
 

zzn

Member
Banned User
Jul 27, 2022
89
8
8
I have this exact issue in my to do list for one WordPress website.

When I get to it and fix the problem, I will share the solution here for you and anyone else who is interested. But this might take a while.
 

lonewolf000

New member
Jul 20, 2022
21
4
3
 

About us

  • Our community has been around for many years and pride ourselves on offering unbiased, critical discussion among people of all different backgrounds. We are working every day to make sure our community is one of the best.

Quick Navigation

User Menu