# How can I delete a tag in development database (on local)?

**URL:** https://meta.discourse.org/t/how-can-i-delete-a-tag-in-development-database-on-local/161797
**Category:** Support
**Created:** [August 23, 2020, 6:53am UTC](https://meta.discourse.org/t/how-can-i-delete-a-tag-in-development-database-on-local/161797 "2020-08-23T06:53:26Z")
**Posts on this page:** 1
**Showing post:** 4

<div class="post-metadata">

### Author: ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)
#### Post date: [August 24, 2020, 9:00pm UTC](https://meta.discourse.org/t/how-can-i-delete-a-tag-in-development-database-on-local/161797/4 "2020-08-24T21:00:29Z")

</div>

> [@Pad\_Pors](#):
>
> is it possible to delete a tag from a database that hasn’t been running yet? i.e. from a backup, which can’t be restored (because of the duplicated tag problem)?

If I was doing this myself, I would start by going back to the site that the backup file was created on, delete the tag through the Rails console, then create a new backup file.

If that is not possible, or if it does not solve the duplicate tag issue, you could delete the row from the table by opening a psql terminal on it. Something like:

```plaintext
DELETE FROM tags WHERE name = <your_tag_name>;

```

My concern with this is that it will not remove usages of the deleted tag from the site’s database in the same way as is done if you use the Rails `destroy!` command. It might be a good idea to test this out on a copy of the backup file to make sure that it does not break anything.

It might also be a good idea to run a `SELECT` statement before deleting the tag. That might show the cause of the issue:

```sql
SELECT FROM tags WHERE name = <your_tag_name>;

```

---

_[View the full topic](https://meta.discourse.org/t/how-can-i-delete-a-tag-in-development-database-on-local/161797)._
