---
title: "How to delete Agile Cards templates directly from database"
canonical: "https://support.appfire.com/space/SUPPORT/898433979/How+to+delete+Agile+Cards+templates+directly+from+database"
format: markdown
---
## Purpose

This page describes how to manually delete the templates from Agile Cards from a database perspective.

In some cases, with many templates, the Jira administrator might want to delete the templates in bulk, using a script, for example. Such an option is unavailable in Agile Cards GUI, but it can be done when the admin logs in to the database. 

## Runbook:

Connect to the database using the SQL command line tool and connect to the Jira schema:

> ℹ️ The following runbook presents a connection to the docker container. To connect to the db hosted as a PostgreSQL server on the VM, please refer to [KB : Connect Jira with PostgreSQL Database](https://appfire.atlassian.net/wiki/spaces/SUPPORT/pages/607879203)

![image](media://923a1616-04ec-467f-815c-05d8662e770f)

Execute the following script:

```sql
select * from "AO_4CB44A_TEMPLATE";
select * from "AO_4CB44A_TEMPLATE_PROJECT";
```

The output should present the list of all templates with the template ID and in terms of project template 

Now, the admin can delete the multiple templates by executing the following:

```
DELETE FROM "AO_4CB44A_TEMPLATE" WHERE "id" IN (ID_1, ID_2, ..., ID_N)
```

Templates might also be deleted from `"AO_4CB44A_TEMPLATE_PROJECT"; `which contains project templates. The delete statement should be executed accordingly.

> ⚠️ The user that wants to delete the Agile Cards templates must have the `DELETE` privilege on the table to delete from it, as well as the `SELECT` privilege for any table in the `USING` clause or whose values are read in the `condition`.