Hi Long Nguyen
I found the following on the internet:
DELETE p,tr,pm
FROM wp_posts p
LEFT JOIN wp_term_relationships tr
ON (p.ID = tr.object_id)
LEFT JOIN wp_postmeta pm
ON (p.ID = pm.post_id)
WHERE p.post_type = 'article';
However, I can still see artefacts of the CPT and custom fields. (Admin Menu Pro -> Metabox: I can see the CPT I deleted)
What is the SQL I can use to completely remove CPT and custom fields.
Perhaps this should also be a feature in Metabox, since Metabox created the CPT, it should also be responsible for deleting it.
The 3rd party plugin you recommended does not work without paying for the PRO version (I think), and it does not show you what they are going to delete and ask you to confirm... so it is even more dangerous than SQL (which at least I can do a select and see the rows affected).
SELECT *
FROM wp_posts p
LEFT JOIN wp_term_relationships tr
ON (p.ID = tr.object_id)
LEFT JOIN wp_postmeta pm
ON (p.ID = pm.post_id)
WHERE p.post_type = 'article';