Quantcast
Channel: Topic Tag: MySQL | WordPress.org
Viewing all articles
Browse latest Browse all 5527

songdogtech on "Database Full"

$
0
0

Could be spam; you can truncate the wp_comments table with a database utility to delete all comments at once. (Use phpmyadmin in your Cpanel, or adminer http://www.adminer.org/ as a standalone file you can drop in via FTP).

Clearing post and page revisions will greatly reduce the size of a WP database - up to 90% in some cases (with a huge return in site speed.)

Since you can't log into admin, run the query below as an SQL query in phpmyadmin to delete revisions; change table prefix as necessary. (Use phpmyadmin in your Cpanel, or adminer http://www.adminer.org/ as a standalone file you can drop in via FTP).

DELETE a,b,c
FROM wp_posts a
LEFT JOIN wp_term_relationships b ON (a.ID = b.object_id)
LEFT JOIN wp_postmeta c ON (a.ID = c.post_id)
WHERE a.post_type = 'revision'

Then optimize all tables. And then add

define ('WP_POST_REVISIONS', FALSE);

near the top of wp-config.php to prevent the creation of all future revisions.


Viewing all articles
Browse latest Browse all 5527

Trending Articles