{"id":11437,"date":"2026-09-07T18:20:48","date_gmt":"2026-09-07T12:50:48","guid":{"rendered":"https:\/\/pheonixsolutions.com\/blog\/?p=11437"},"modified":"2026-09-07T18:22:54","modified_gmt":"2026-09-07T12:52:54","slug":"how-to-delete-deactivated-metabase-users-from-the-database","status":"publish","type":"post","link":"https:\/\/pheonixsolutions.com\/blog\/how-to-delete-deactivated-metabase-users-from-the-database\/","title":{"rendered":"How to Delete Deactivated Metabase Users from the Database?"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">Introduction<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Metabase does not provide an official option to permanently delete user accounts. When a user is deactivated, Metabase marks the account as inactive and prevents the user from logging in, while preserving the user&#8217;s questions, dashboards, models, and other content.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In some administrative or data-retention scenarios, you may need to permanently remove a <strong>deactivated user<\/strong> and their associated records from the Metabase application database.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\"><strong>Important:<\/strong> Take a complete backup of the Metabase application database before making any changes.<\/p>\n<\/blockquote>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Prerequisites<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Before proceeding, ensure that you have:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Root or administrative access to the Metabase application database.<\/li>\n\n\n\n<li>Access to the Metabase application database.<\/li>\n\n\n\n<li>A valid database backup.<\/li>\n\n\n\n<li>The email address or user ID of the deactivated user.<\/li>\n\n\n\n<li>Basic knowledge of SQL.<\/li>\n\n\n\n<li>The Metabase service stopped before making direct database modifications.<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">Metabase supports PostgreSQL, MySQL, and MariaDB as application databases, with PostgreSQL recommended for production environments.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">Implementation<\/h1>\n\n\n\n<h4 class=\"wp-block-heading\">Step 1: Identify the Metabase Application Database<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">First, identify which database Metabase is using as its <strong>application database<\/strong>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The application database is different from the databases that Metabase connects to for reporting and analytics. Metabase stores users, questions, dashboards, and application configuration in the application database.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For example, if Metabase is using PostgreSQL:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">psql -U metabase -d metabase<\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h4 class=\"wp-block-heading\">Step 2: Take a Database Backup<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Before deleting anything, take a complete backup.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">pg_dump -U metabase metabase &gt; metabase_backup.sql<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Verify that the backup file was created successfully before continuing.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h4 class=\"wp-block-heading\">Step 3: Find the Deactivated User<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Metabase stores user information in the <code>core_user<\/code> table in its application database.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For example:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">SELECT id, email, first_name, last_name, is_active<br>FROM core_user<br>WHERE is_active = false;<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">To find a specific user:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">SELECT id, email, first_name, last_name, is_active<br>FROM core_user<br>WHERE email = 'user@example.com';<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Example output:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\"> id | email             | first_name | last_name | is_active\n----+-------------------+------------+-----------+----------\n 15 | user@example.com  | Test       | User      | false<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Here, the user ID is <code>15<\/code>.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h4 class=\"wp-block-heading\">Step 4: Confirm the User Is Deactivated<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Before deleting the account, make sure the user is actually inactive:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">SELECT id, email, is_active<br>FROM core_user<br>WHERE id = 15;<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">You should see:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">is_active\n---------\nfalse<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Do <strong>not<\/strong> proceed with deleting an active account unless you have a specific, tested procedure for doing so.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h4 class=\"wp-block-heading\">Step 5: Check User References<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">This is the most important step.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A Metabase user may be referenced by other application tables. Deleting only the <code>core_user<\/code> record can result in constraint violations or leave inconsistent application data. Metabase community guidance specifically warns that users can have references in groups, collections, activity, reports, and other tables.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You should therefore inspect the database schema before deleting the user.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For PostgreSQL, you can inspect foreign-key relationships using:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">SELECT<br>    tc.table_name,<br>    kcu.column_name,<br>    ccu.table_name AS foreign_table_name,<br>    ccu.column_name AS foreign_column_name<br>FROM information_schema.table_constraints AS tc<br>JOIN information_schema.key_column_usage AS kcu<br>    ON tc.constraint_name = kcu.constraint_name<br>JOIN information_schema.constraint_column_usage AS ccu<br>    ON ccu.constraint_name = tc.constraint_name<br>WHERE tc.constraint_type = 'FOREIGN KEY'<br>  AND ccu.table_name = 'core_user';<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This helps identify tables that reference <code>core_user<\/code>.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h4 class=\"wp-block-heading\">Step 6: Check Whether the User Owns Metabase Content<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Before deleting the user, check whether the account is associated with important content such as questions, dashboards, collections, subscriptions, or other objects.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For example, you can inspect the schema and identify tables containing user references.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Do not blindly run <code>DELETE<\/code> statements against tables based on an old Metabase version&#8217;s schema.<\/strong> Table relationships can change between Metabase releases.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Instead, first inspect your installed version&#8217;s actual schema.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h4 class=\"wp-block-heading\">Step 7: Delete the User<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">If you have confirmed that the user has no remaining dependencies that would prevent deletion, the final deletion would involve removing the corresponding user record from the application database.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For example:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">DELETE FROM core_user<br>WHERE id = 15<br>  AND is_active = false;<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Then verify:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">SELECT id, email, is_active<br>FROM core_user<br>WHERE id = 15;<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">If the query returns no rows, the user record has been removed from <code>core_user<\/code>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>However, this does not automatically mean that all related records have been safely removed.<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h4 class=\"wp-block-heading\">Step 8: Start Metabase and Verify<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">After completing the database changes, start Metabase again.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For a systemd installation:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">systemctl start metabase<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Then monitor the logs:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">journalctl -u metabase -f<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">If Metabase is running in Docker:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">docker logs -f metabase<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Check that Metabase starts normally and that there are no database constraint or application errors.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Metabase does not provide an officially supported mechanism for permanently deleting user accounts. The standard approach is to deactivate the account, which prevents login while preserving the user&#8217;s Metabase content.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If permanent deletion is absolutely required, administrators can technically remove records from the Metabase application database, but this should be treated as a <strong>high-risk database administration task<\/strong>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The recommended procedure is:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Take a complete Metabase application database backup.<\/li>\n\n\n\n<li>Identify the deactivated user&#8217;s ID.<\/li>\n\n\n\n<li>Check all references to the user.<\/li>\n\n\n\n<li>Remove dependent records only where appropriate.<\/li>\n\n\n\n<li>Remove the user record.<\/li>\n\n\n\n<li>Start Metabase.<\/li>\n\n\n\n<li>Check the Metabase logs.<\/li>\n\n\n\n<li>Verify that Metabase is functioning correctly.<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">Never run a simple <code>DELETE FROM core_user<\/code> on a production Metabase database without first understanding the relationships in your specific Metabase version. Community guidance has specifically warned that users can have references across multiple application tables.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">FAQs<\/h2>\n\n\n\n<h5 class=\"wp-block-heading\">1. Can I permanently delete a Metabase user?<\/h5>\n\n\n\n<p class=\"wp-block-paragraph\">Metabase does not officially support permanent account deletion. The supported operation is deactivation.<\/p>\n\n\n\n<h5 class=\"wp-block-heading\">2. Where are Metabase users stored?<\/h5>\n\n\n\n<p class=\"wp-block-paragraph\">Metabase stores user account information in its application database. In commonly used Metabase schemas, the primary user table is <code>core_user<\/code>.<\/p>\n\n\n\n<h5 class=\"wp-block-heading\">3. Can I simply run this query?<\/h5>\n\n\n\n<pre class=\"wp-block-preformatted\">DELETE FROM core_user WHERE id = 15;<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">It is <strong>not recommended<\/strong> to do this without checking dependencies first. Other Metabase tables may reference the user.<\/p>\n\n\n\n<h5 class=\"wp-block-heading\">4. Why did my <code>DELETE FROM core_user<\/code> query fail?<\/h5>\n\n\n\n<p class=\"wp-block-paragraph\">The user may be referenced by other Metabase tables through foreign-key constraints. You must identify and handle those dependencies before deleting the user.<\/p>\n\n\n\n<h5 class=\"wp-block-heading\">5. Should I stop Metabase before modifying its application database?<\/h5>\n\n\n\n<p class=\"wp-block-paragraph\">Yes. Stopping Metabase prevents the application from accessing or modifying the database while you are making direct database changes.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Related Articles<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/pheonixsolutions.com\/blog\/how-to-list-configured-databases-in-metabase-using-cli-api\/\">How to List Configured Databases in Metabase Using CLI\/API? &#8211; Pheonix Solutions<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/pheonixsolutions.com\/blog\/how-to-add-a-database-to-metabase-via-cli-using-the-rest-api\/\">How to Add a Database to Metabase via CLI Using the REST API &#8211; Pheonix Solutions<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Talk to our experts<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Have a technology challenge or looking for the right solution for your business? Our team can help you with <strong>cloud, DevOps, development, infrastructure, design, and more<\/strong>. Feel free to reach out to our experts <a href=\"https:\/\/pheonixsolutions.com\/contact\">here<\/a>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction Metabase does not provide an official option to permanently delete user accounts. When a user is deactivated, Metabase marks [&hellip;]<\/p>\n","protected":false},"author":496,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[1],"tags":[],"class_list":["post-11437","post","type-post","status-publish","format-standard","hentry","category-uncategorized","psol-cat-uncategorized"],"jetpack_publicize_connections":[],"jetpack_shortlink":"https:\/\/wp.me\/phn2x7-2Yt","jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/11437","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/users\/496"}],"replies":[{"embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/comments?post=11437"}],"version-history":[{"count":2,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/11437\/revisions"}],"predecessor-version":[{"id":11485,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/11437\/revisions\/11485"}],"wp:attachment":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=11437"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=11437"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=11437"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}