6

I want to delete some of the tags that are entered in the system.

Since there is no way to do that in Control Panel, and there is not a valid plugin that can do this (know that from my previous question).

The only way to delete tags is in the database. So I found this comment. I think this is for CraftCMS 2, but is it still the same and for CraftCMS 3?

2
  • Just as a comment, I find that using categories instead of tags gives you much more control, especially if this is a site you are opening up to an end client.
    – Jamie Wade
    Aug 29, 2018 at 7:57
  • I use categories in one project before. But since there is not need for grouping filters in this one, I decide to use tags. I was not aware that there is`t tag management system build in CraftCMS since I need it. Aug 29, 2018 at 9:13

2 Answers 2

5

I do believe this plugin can help?

https://github.com/ethercreative/tags

5

Yes the same still applies. You can either delete it via DB directly in your {{%elements}} column or you can just run

PHP

Craft::$app->getElements()->deleteElementById(x)

Twig

{% do craft.app.getElements().deleteElementById(x) %}
1
  • Just deleting the rows in the database elements table doesn't remove them from the content table, so probably best to do it via PHP or Twig.
    – kmgdev
    Jan 24, 2019 at 19:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.