{"id":10386,"date":"2026-09-11T07:20:00","date_gmt":"2026-09-11T05:20:00","guid":{"rendered":"https:\/\/www.lukaswojcik.com\/blog\/?p=10386"},"modified":"2026-09-09T17:06:33","modified_gmt":"2026-09-09T15:06:33","slug":"wp-cli-delete-commands-which-tables-each-one-touches-and-what-it-leaves","status":"publish","type":"post","link":"https:\/\/www.lukaswojcik.com\/blog\/en\/wordpress-plugins-tricks\/wp-cli-delete-commands-which-tables-each-one-touches-and-what-it-leaves\/","title":{"rendered":"WP-CLI Delete Commands: Which Tables Each One Touches and What It Leaves Behind"},"content":{"rendered":"<p>Database housekeeping in WordPress is a handful of commands that all look alike and behave nothing alike. One goes through the application and cleans up after itself; the next one touches a single table and leaves four others holding rows that point at nothing.<\/p>\n<p>What makes the difference matter is that WP-CLI, with a few exceptions, has no dry run. There is no way to ask a delete command what it would do. There is only the discipline of asking a different command first.<\/p>\n<figure class=\"lw-diagram\">\n<img decoding=\"async\" src=\"https:\/\/www.lukaswojcik.com\/blog\/wp-content\/uploads\/diagrams\/loeschbefehle-en.png\" width=\"1120\" height=\"580\" loading=\"lazy\" alt=\"Two table maps side by side: wp post delete removes the post row together with meta, comments, comment meta and term relationships; a direct SQL DELETE removes only the post row and leaves 43 orphaned rows\"><figcaption>The same row, two ways of removing it. The right-hand version reports success just as cheerfully.<\/figcaption><\/figure>\n<h2>The Two-Step Pattern That Replaces the Dry Run<\/h2>\n<p>Every destructive command has a harmless sibling that takes the same filter. <code>wp post delete<\/code> has <code>wp post list<\/code>; <code>wp comment delete<\/code> has <code>wp comment list<\/code>. Running the list first with <code>--format=count<\/code> answers the only question a dry run would have answered: how many rows is this about to remove.<\/p>\n<pre class=\"wp-block-kevinbatdorf-code-block-pro\"><code># 0. a backup, outside the document root\nwp db export \/home\/pi\/backup-$(date +%F).sql\n\n# 1. count, with exactly the filter that will be used\nwp post list --post_type=revision --format=count\n\n# 2. delete, with exactly the same filter\nwp post list --post_type=revision --format=ids | xargs -n 100 wp post delete --force<\/code><\/pre>\n<p>The <code>xargs<\/code> in the last line is not decoration. Substituting several thousand IDs directly into the command line runs into the argument length limit, and the failure arrives after some of the work is done rather than before any of it &#8211; which is the one situation the whole exercise was meant to avoid.<\/p>\n<p>The backup line has a detail worth keeping: without a path, <code>wp db export<\/code> writes the dump into the current directory, and the current directory during a WordPress command is usually the document root. A full database dump with a guessable name, served over HTTP, is a worse outcome than anything the cleanup was going to fix.<\/p>\n<h2>Two Ways to Remove the Same Row<\/h2>\n<p><code>wp post delete<\/code> calls the same function the editor calls. It removes the post meta, the comments, the comment meta and the term relationships, and it fires the hooks that let plugins remove whatever they attached elsewhere &#8211; a search index entry, a cache, a row in their own table.<\/p>\n<p>A direct <code>DELETE FROM wp_posts<\/code> removes one row. Everything that referred to it stays, unreachable and invisible: no query joins to a post that is gone, so the rows simply never appear again. That is tolerable until an ID is reused, and post IDs are reused after a database import &#8211; at which point the new post silently inherits the old one&#8217;s custom fields and comments.<\/p>\n<h2>What Each Command Actually Touches<\/h2>\n<table style=\"width:100%;border-collapse:collapse\">\n<thead>\n<tr>\n<th style=\"vertical-align:top\">Command<\/th>\n<th>Removes<\/th>\n<th>Leaves behind<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"vertical-align:top\"><code>wp post delete &lt;id&gt; --force<\/code><\/td>\n<td>post, meta, comments, term links<\/td>\n<td>the attached media files and their attachment rows<\/td>\n<\/tr>\n<tr>\n<td style=\"vertical-align:top\"><code>wp post delete &lt;attachment&gt; --force<\/code><\/td>\n<td>the row and the files on disk, all sizes<\/td>\n<td>references to the URL inside other posts<\/td>\n<\/tr>\n<tr>\n<td style=\"vertical-align:top\"><code>wp post delete &lt;revisions&gt;<\/code><\/td>\n<td>the revisions and their own meta rows<\/td>\n<td>the parent post, untouched<\/td>\n<\/tr>\n<tr>\n<td style=\"vertical-align:top\"><code>wp comment delete --status=spam<\/code><\/td>\n<td>comments and comment meta<\/td>\n<td>the per-post comment counts, until a recount<\/td>\n<\/tr>\n<tr>\n<td style=\"vertical-align:top\"><code>wp transient delete --expired<\/code><\/td>\n<td>only transients whose expiry has passed<\/td>\n<td>every transient stored without an expiry<\/td>\n<\/tr>\n<tr>\n<td style=\"vertical-align:top\"><code>wp db optimize<\/code><\/td>\n<td>nothing<\/td>\n<td>a table lock for the duration of the rebuild<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>The first row is the one that surprises people. Deleting a post does not delete the images in it &#8211; attachments are posts in their own right, with their own IDs, and they survive their parent. A site cleaned of a thousand old posts therefore still carries a thousand posts&#8217; worth of media, which is where the disk space actually went.<\/p>\n<p>The comment count row is the cheapest to fix and the easiest to forget: after any bulk comment deletion, <code>wp comment recount<\/code> puts the numbers back in agreement with the rows. Nothing breaks without it; the counts are simply wrong, everywhere, quietly.<\/p>\n<h2>The Trash Is Not a Backup<\/h2>\n<p>Without <code>--force<\/code>, deleting moves a post to the trash, which is a status change and nothing more. The row stays, the meta stays, the media stays, and the space is not freed &#8211; a trash emptied once a month is a housekeeping habit, not a safety net.<\/p>\n<p>With <code>--force<\/code> the post skips the trash entirely and there is no undo inside WordPress at all. The only thing standing between a mistyped filter and a lost month is the dump written in step zero, which is the reason it is step zero.<\/p>\n<h2>Expired Is Not the Same as All<\/h2>\n<p>Transients are a cache with an expiry stored alongside the value. <code>wp transient delete --expired<\/code> removes those whose time has passed and is safe by construction: anything it deletes was already invalid.<\/p>\n<p><code>--all<\/code> is a different command wearing the same name. It also removes transients stored without an expiry, and some plugins use exactly those as their only storage for something that was expensive to compute &#8211; a licence check, an inventory, a rendered menu. Nothing breaks visibly; the site simply spends the next hour rebuilding things nobody asked it to rebuild, and one or two plugins behave as if they had just been installed.<\/p>\n<h2>Optimising Is a Rebuild, Not a Tidy-Up<\/h2>\n<p><code>wp db optimize<\/code> runs <code>OPTIMIZE TABLE<\/code>, and for InnoDB that is not an optimisation but a full rebuild of the table plus its indexes. The table is locked for writes while it happens, which on a small blog is a second and on a large <code>wp_postmeta<\/code> is long enough for visitors to notice.<\/p>\n<p>It is also the step that most reliably reclaims nothing. Space freed by deleted rows is already reused by InnoDB for new rows; the file on disk only shrinks if a great deal was deleted and nothing has been written since. Worth running once after a large cleanup, at a quiet hour, and not worth putting in a nightly cron &#8211; which is precisely where it usually ends up.<\/p>\n<div class=\"lw-quellen\">\n<h2>Sources<\/h2>\n<ul>\n<li><a href=\"https:\/\/developer.wordpress.org\/cli\/commands\/\" target=\"_blank\" rel=\"noopener noreferrer\">WP-CLI command reference<\/a><\/li>\n<\/ul>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>WP-CLI has no dry run. Which makes it worth knowing, before pressing return, which tables a command touches, which rows it leaves behind, and why the leftovers are a correctness problem rather than a size one.<\/p>\n","protected":false},"author":1,"featured_media":15164,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[91104,91096],"class_list":["post-10386","post","type-post","status-publish","format-standard","hentry","category-wordpress-plugins-tricks","tag-mysql","tag-wordpress"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>WP-CLI Delete Commands: Which Tables Each One Touches and What It Leaves Behind - Lukas Wojcik - Blog<\/title>\n<meta name=\"description\" content=\"Revisions, transients, spam and orphaned meta: what each WP-CLI delete command actually removes, and the two-step pattern that replaces the missing dry run.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.lukaswojcik.com\/blog\/en\/wordpress-plugins-tricks\/wp-cli-delete-commands-which-tables-each-one-touches-and-what-it-leaves\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"WP-CLI Delete Commands: Which Tables Each One Touches and What It Leaves Behind - Lukas Wojcik - Blog\" \/>\n<meta property=\"og:description\" content=\"Revisions, transients, spam and orphaned meta: what each WP-CLI delete command actually removes, and the two-step pattern that replaces the missing dry run.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.lukaswojcik.com\/blog\/en\/wordpress-plugins-tricks\/wp-cli-delete-commands-which-tables-each-one-touches-and-what-it-leaves\/\" \/>\n<meta property=\"og:site_name\" content=\"Lukas Wojcik - Blog\" \/>\n<meta property=\"article:published_time\" content=\"2026-09-11T05:20:00+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.lukaswojcik.com\/blog\/wp-content\/uploads\/2026\/09\/hero-10386-what-every-delete-command-really-rem-n.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"630\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"luky\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"luky\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/en\\\/wordpress-plugins-tricks\\\/wp-cli-delete-commands-which-tables-each-one-touches-and-what-it-leaves\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/en\\\/wordpress-plugins-tricks\\\/wp-cli-delete-commands-which-tables-each-one-touches-and-what-it-leaves\\\/\"},\"author\":{\"name\":\"luky\",\"@id\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/#\\\/schema\\\/person\\\/895f7604f9b6b71aad9bba33af28d0f9\"},\"headline\":\"WP-CLI Delete Commands: Which Tables Each One Touches and What It Leaves Behind\",\"datePublished\":\"2026-09-11T05:20:00+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/en\\\/wordpress-plugins-tricks\\\/wp-cli-delete-commands-which-tables-each-one-touches-and-what-it-leaves\\\/\"},\"wordCount\":894,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/#\\\/schema\\\/person\\\/895f7604f9b6b71aad9bba33af28d0f9\"},\"image\":{\"@id\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/en\\\/wordpress-plugins-tricks\\\/wp-cli-delete-commands-which-tables-each-one-touches-and-what-it-leaves\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/09\\\/hero-10386-what-every-delete-command-really-rem-n.png\",\"keywords\":[\"MySQL\",\"WordPress\"],\"articleSection\":[\"WordPress Plugins &amp; Tricks\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/en\\\/wordpress-plugins-tricks\\\/wp-cli-delete-commands-which-tables-each-one-touches-and-what-it-leaves\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/en\\\/wordpress-plugins-tricks\\\/wp-cli-delete-commands-which-tables-each-one-touches-and-what-it-leaves\\\/\",\"url\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/en\\\/wordpress-plugins-tricks\\\/wp-cli-delete-commands-which-tables-each-one-touches-and-what-it-leaves\\\/\",\"name\":\"WP-CLI Delete Commands: Which Tables Each One Touches and What It Leaves Behind - Lukas Wojcik - Blog\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/en\\\/wordpress-plugins-tricks\\\/wp-cli-delete-commands-which-tables-each-one-touches-and-what-it-leaves\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/en\\\/wordpress-plugins-tricks\\\/wp-cli-delete-commands-which-tables-each-one-touches-and-what-it-leaves\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/09\\\/hero-10386-what-every-delete-command-really-rem-n.png\",\"datePublished\":\"2026-09-11T05:20:00+00:00\",\"description\":\"Revisions, transients, spam and orphaned meta: what each WP-CLI delete command actually removes, and the two-step pattern that replaces the missing dry run.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/en\\\/wordpress-plugins-tricks\\\/wp-cli-delete-commands-which-tables-each-one-touches-and-what-it-leaves\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/en\\\/wordpress-plugins-tricks\\\/wp-cli-delete-commands-which-tables-each-one-touches-and-what-it-leaves\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/en\\\/wordpress-plugins-tricks\\\/wp-cli-delete-commands-which-tables-each-one-touches-and-what-it-leaves\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/09\\\/hero-10386-what-every-delete-command-really-rem-n.png\",\"contentUrl\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/09\\\/hero-10386-what-every-delete-command-really-rem-n.png\",\"width\":1200,\"height\":630,\"caption\":\"WP-CLI Delete Commands: Which Tables Each One Touches and What It Leaves Behind\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/en\\\/wordpress-plugins-tricks\\\/wp-cli-delete-commands-which-tables-each-one-touches-and-what-it-leaves\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"WP-CLI Delete Commands: Which Tables Each One Touches and What It Leaves Behind\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/\",\"name\":\"Lukas Wojcik - Blog\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/#\\\/schema\\\/person\\\/895f7604f9b6b71aad9bba33af28d0f9\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/#\\\/schema\\\/person\\\/895f7604f9b6b71aad9bba33af28d0f9\",\"name\":\"luky\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/07\\\/lw-x2.jpg\",\"url\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/07\\\/lw-x2.jpg\",\"contentUrl\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/07\\\/lw-x2.jpg\",\"width\":424,\"height\":636,\"caption\":\"luky\"},\"logo\":{\"@id\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/07\\\/lw-x2.jpg\"},\"sameAs\":[\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\"],\"url\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/author\\\/luky\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"WP-CLI Delete Commands: Which Tables Each One Touches and What It Leaves Behind - Lukas Wojcik - Blog","description":"Revisions, transients, spam and orphaned meta: what each WP-CLI delete command actually removes, and the two-step pattern that replaces the missing dry run.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.lukaswojcik.com\/blog\/en\/wordpress-plugins-tricks\/wp-cli-delete-commands-which-tables-each-one-touches-and-what-it-leaves\/","og_locale":"en_US","og_type":"article","og_title":"WP-CLI Delete Commands: Which Tables Each One Touches and What It Leaves Behind - Lukas Wojcik - Blog","og_description":"Revisions, transients, spam and orphaned meta: what each WP-CLI delete command actually removes, and the two-step pattern that replaces the missing dry run.","og_url":"https:\/\/www.lukaswojcik.com\/blog\/en\/wordpress-plugins-tricks\/wp-cli-delete-commands-which-tables-each-one-touches-and-what-it-leaves\/","og_site_name":"Lukas Wojcik - Blog","article_published_time":"2026-09-11T05:20:00+00:00","og_image":[{"width":1200,"height":630,"url":"https:\/\/www.lukaswojcik.com\/blog\/wp-content\/uploads\/2026\/09\/hero-10386-what-every-delete-command-really-rem-n.png","type":"image\/png"}],"author":"luky","twitter_card":"summary_large_image","twitter_misc":{"Written by":"luky","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.lukaswojcik.com\/blog\/en\/wordpress-plugins-tricks\/wp-cli-delete-commands-which-tables-each-one-touches-and-what-it-leaves\/#article","isPartOf":{"@id":"https:\/\/www.lukaswojcik.com\/blog\/en\/wordpress-plugins-tricks\/wp-cli-delete-commands-which-tables-each-one-touches-and-what-it-leaves\/"},"author":{"name":"luky","@id":"https:\/\/www.lukaswojcik.com\/blog\/#\/schema\/person\/895f7604f9b6b71aad9bba33af28d0f9"},"headline":"WP-CLI Delete Commands: Which Tables Each One Touches and What It Leaves Behind","datePublished":"2026-09-11T05:20:00+00:00","mainEntityOfPage":{"@id":"https:\/\/www.lukaswojcik.com\/blog\/en\/wordpress-plugins-tricks\/wp-cli-delete-commands-which-tables-each-one-touches-and-what-it-leaves\/"},"wordCount":894,"commentCount":0,"publisher":{"@id":"https:\/\/www.lukaswojcik.com\/blog\/#\/schema\/person\/895f7604f9b6b71aad9bba33af28d0f9"},"image":{"@id":"https:\/\/www.lukaswojcik.com\/blog\/en\/wordpress-plugins-tricks\/wp-cli-delete-commands-which-tables-each-one-touches-and-what-it-leaves\/#primaryimage"},"thumbnailUrl":"https:\/\/www.lukaswojcik.com\/blog\/wp-content\/uploads\/2026\/09\/hero-10386-what-every-delete-command-really-rem-n.png","keywords":["MySQL","WordPress"],"articleSection":["WordPress Plugins &amp; Tricks"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.lukaswojcik.com\/blog\/en\/wordpress-plugins-tricks\/wp-cli-delete-commands-which-tables-each-one-touches-and-what-it-leaves\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.lukaswojcik.com\/blog\/en\/wordpress-plugins-tricks\/wp-cli-delete-commands-which-tables-each-one-touches-and-what-it-leaves\/","url":"https:\/\/www.lukaswojcik.com\/blog\/en\/wordpress-plugins-tricks\/wp-cli-delete-commands-which-tables-each-one-touches-and-what-it-leaves\/","name":"WP-CLI Delete Commands: Which Tables Each One Touches and What It Leaves Behind - Lukas Wojcik - Blog","isPartOf":{"@id":"https:\/\/www.lukaswojcik.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.lukaswojcik.com\/blog\/en\/wordpress-plugins-tricks\/wp-cli-delete-commands-which-tables-each-one-touches-and-what-it-leaves\/#primaryimage"},"image":{"@id":"https:\/\/www.lukaswojcik.com\/blog\/en\/wordpress-plugins-tricks\/wp-cli-delete-commands-which-tables-each-one-touches-and-what-it-leaves\/#primaryimage"},"thumbnailUrl":"https:\/\/www.lukaswojcik.com\/blog\/wp-content\/uploads\/2026\/09\/hero-10386-what-every-delete-command-really-rem-n.png","datePublished":"2026-09-11T05:20:00+00:00","description":"Revisions, transients, spam and orphaned meta: what each WP-CLI delete command actually removes, and the two-step pattern that replaces the missing dry run.","breadcrumb":{"@id":"https:\/\/www.lukaswojcik.com\/blog\/en\/wordpress-plugins-tricks\/wp-cli-delete-commands-which-tables-each-one-touches-and-what-it-leaves\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.lukaswojcik.com\/blog\/en\/wordpress-plugins-tricks\/wp-cli-delete-commands-which-tables-each-one-touches-and-what-it-leaves\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.lukaswojcik.com\/blog\/en\/wordpress-plugins-tricks\/wp-cli-delete-commands-which-tables-each-one-touches-and-what-it-leaves\/#primaryimage","url":"https:\/\/www.lukaswojcik.com\/blog\/wp-content\/uploads\/2026\/09\/hero-10386-what-every-delete-command-really-rem-n.png","contentUrl":"https:\/\/www.lukaswojcik.com\/blog\/wp-content\/uploads\/2026\/09\/hero-10386-what-every-delete-command-really-rem-n.png","width":1200,"height":630,"caption":"WP-CLI Delete Commands: Which Tables Each One Touches and What It Leaves Behind"},{"@type":"BreadcrumbList","@id":"https:\/\/www.lukaswojcik.com\/blog\/en\/wordpress-plugins-tricks\/wp-cli-delete-commands-which-tables-each-one-touches-and-what-it-leaves\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.lukaswojcik.com\/blog\/"},{"@type":"ListItem","position":2,"name":"WP-CLI Delete Commands: Which Tables Each One Touches and What It Leaves Behind"}]},{"@type":"WebSite","@id":"https:\/\/www.lukaswojcik.com\/blog\/#website","url":"https:\/\/www.lukaswojcik.com\/blog\/","name":"Lukas Wojcik - Blog","description":"","publisher":{"@id":"https:\/\/www.lukaswojcik.com\/blog\/#\/schema\/person\/895f7604f9b6b71aad9bba33af28d0f9"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.lukaswojcik.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/www.lukaswojcik.com\/blog\/#\/schema\/person\/895f7604f9b6b71aad9bba33af28d0f9","name":"luky","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.lukaswojcik.com\/blog\/wp-content\/uploads\/2026\/07\/lw-x2.jpg","url":"https:\/\/www.lukaswojcik.com\/blog\/wp-content\/uploads\/2026\/07\/lw-x2.jpg","contentUrl":"https:\/\/www.lukaswojcik.com\/blog\/wp-content\/uploads\/2026\/07\/lw-x2.jpg","width":424,"height":636,"caption":"luky"},"logo":{"@id":"https:\/\/www.lukaswojcik.com\/blog\/wp-content\/uploads\/2026\/07\/lw-x2.jpg"},"sameAs":["https:\/\/www.lukaswojcik.com\/blog"],"url":"https:\/\/www.lukaswojcik.com\/blog\/author\/luky\/"}]}},"_links":{"self":[{"href":"https:\/\/www.lukaswojcik.com\/blog\/wp-json\/wp\/v2\/posts\/10386","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.lukaswojcik.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.lukaswojcik.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.lukaswojcik.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.lukaswojcik.com\/blog\/wp-json\/wp\/v2\/comments?post=10386"}],"version-history":[{"count":3,"href":"https:\/\/www.lukaswojcik.com\/blog\/wp-json\/wp\/v2\/posts\/10386\/revisions"}],"predecessor-version":[{"id":17380,"href":"https:\/\/www.lukaswojcik.com\/blog\/wp-json\/wp\/v2\/posts\/10386\/revisions\/17380"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.lukaswojcik.com\/blog\/wp-json\/wp\/v2\/media\/15164"}],"wp:attachment":[{"href":"https:\/\/www.lukaswojcik.com\/blog\/wp-json\/wp\/v2\/media?parent=10386"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.lukaswojcik.com\/blog\/wp-json\/wp\/v2\/categories?post=10386"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.lukaswojcik.com\/blog\/wp-json\/wp\/v2\/tags?post=10386"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}