# Removing accidentally created workspaces

By default, UI Bakery allows users to create their own organizations. When a user is not invited to any organization and registers for the first time, one of the options is to create a new workspace. This leads to extra workspaces created that are not actually needed.&#x20;

To clean up these unused organizations, you need to take the following steps:

1. First, disable the ability to create new workspaces using this flag:

`UI_BAKERY_SINGLE_ORGANIZATION=true`

2. Run the following SQL query that will delete the organizations by their names:

{% hint style="danger" %}
Before running the script back up your database.
{% endhint %}

```sql
UPDATE project
  INNER JOIN organization ON project.organization_id = organization.id
  SET project.theme_id = null
  WHERE organization.name = 'ORG NAME';

DELETE user FROM user
  INNER JOIN user_organization_role ON user.id = user_organization_role.user_id
  INNER JOIN organization_role ON user_organization_role.organization_role_id = organization_role.id
  INNER JOIN organization ON organization_role.organization_id = organization.id
  WHERE organization.name = 'ORG NAME';

DELETE FROM organization WHERE name = 'ORG NAME';
```

{% hint style="warning" %}
Important thing to keep in mind—in your database there should be **at least two organizations**:

* yours
* id=1, name='bakery' - a system one, <mark style="color:$warning;">you should not remove it</mark>
  {% endhint %}
