Mautic Community Forums

How to delete a tag

Hello,



How can I delete this tag so that is removed from all contacts?



Thanks!



Jan

1 Like

Hello,

How can I delete this tag so that is removed from all contacts?

Thanks!

Jan

Sorry, I don’t understand your question.

@jantheofel

you can tell me when I delete a form “New Standalone Form” tags I put in this form are right it being deleted

@dirk_s Told me he will check if this can be done via API. But this can be just a hotfix. :frowning:

I just played with the database. You can delete the tag there really simple.

Warning: When you want to delete a tag, you probably do not use it for segments, camnpaigns, … The following code does not check this! It just removes the tags assigned to the leads (if any) and the tag itself.

First get the ID for that tag:

mysql> select * from lead_tags where tag = 'tag-to-be-removed'; +----+-----------------+ | id | tag | +----+-----------------+ | 7 | branche:agentur | +----+-----------------+ 1 row in set (0.00 sec)

Then remove that tag from all contacts (replace XX with the id from above, like 7):

mysql> delete from lead_tags_xref where tag_id = XX; Query OK, 860 rows affected (0.05 sec)

Finally remove the tag itself (replace XX with the id):

mysql> delete from lead_tags where id = XX; Query OK, 1 row affected (0.00 sec)

Hope that helps as quick fix.

Jan

And to rename a tag:

update lead_tags set tag = "new-tag-name" where tag = "old-tag-name";

how do i delete a tag that is being duplicated by hazardous writing, in a rapid manner?
Delete is a big issue.