GENWiki

Premier IT Outsourcing and Support Services within the UK

User Tools

Site Tools


joomla:purging_all_trash_at_once_via_sql

Joomla's Trash Management is great unless you have an active site which can include thousands of trashed items. Purging these from the backend fails (still fails) if you try and remove more than 200 at once. The easiest solution (we've found) is to purge them via SQL.

The query below can be thrown into mysql -u xxxx -P or added to a PHP file that executes the query, either way the query is the same. You will need to change the prefix from dev_ to whatever your prefix is.

START TRANSACTION;
 
DELETE FROM dev_content
WHERE id IN (
	SELECT id FROM (
		SELECT a.id FROM dev_content a
			LEFT JOIN dev_users uc ON (uc.id=a.checked_out)
			LEFT JOIN dev_categories c ON (c.id = a.catid)
		WHERE a.state = -2
	) b
);
COMMIT;
/home/gen.uk/domains/wiki.gen.uk/public_html/data/pages/joomla/purging_all_trash_at_once_via_sql.txt · Last modified: 2019/06/20 07:38 by genadmin

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki