Údržba databáze

**WP-Cleanup**
„http://wordpress.org/extend/plugins/wp-cleanup/“:http://wordpress.org/extend/plugins/wp-cleanup/

This WordPress plugin will cleanup your WordPress database, which means that it will perform the following actions:

– Remove all post revisions
– Remove all spam comments
– Remove all unapproved comments
– Remove all unused tags
– Remove all unused post meta
– Optimize MySQL tables by removing all unused table space

**Optimize Database after Deleting Revisions**
„http://wordpress.org/extend/plugins/rvg-optimize-database/“:http://wordpress.org/extend/plugins/rvg-optimize-database/

A ‚One Click‘ WordPress Database Cleaner / Optimizer.

– Deletes redundant revisions of posts and pages (you optionally can keep an ‚x‘-amount of the most recent revisions)
– Deletes trashed posts, pages and comments (optional)
– Deletes spammed comments (optional)
– Deletes ‚orphan postmeta items‘
– Optimizes the database tables (optionally you can exclude certain tables from optimization)
– Creates a log file of the optimizations (optional)
– Optimization can be scheduled to automatically run once hourly, twice daily, once daily or once weekly (optional)

**Plugins Garbage Collector**

Vymaže tabulky po deaktivovaných a nepoužívaných pluginech.
„http://wordpress.org/extend/plugins/plugins-garbage-collector/“:http://wordpress.org/extend/plugins/plugins-garbage-collector/

Nastavení počtu revizí a smazání revizí příspěvků

**Delete-Revision**
„http://wordpress.org/extend/plugins/delete-revision/“:http://wordpress.org/extend/plugins/delete-revision/

V *Nastavení > Delete-Revision > Check Redundant Revision* pak lze vymazat zbytečné revize.

**Revision Control**
„http://wordpress.org/extend/plugins/revision-control“:http://wordpress.org/extend/plugins/revision-control

**Optimize Database after Deleting Revisions**
„http://wordpress.org/plugins/rvg-optimize-database/“:http://wordpress.org/plugins/rvg-optimize-database/

One Click WordPress Database Cleaner / Optimizer.

**Řešení bez použití pluginů:**

v souboru wp-config.php možno nastavit
/—code php
// vypne revize
define(‚WP_POST_REVISIONS‘, false );

// ukládá jen definovaný počet revizí
define(‚WP_POST_REVISIONS‘, 2);

// nastaví interval ukládání ve vteřinách
define(‚AUTOSAVE_INTERVAL‘, 60 );
\—

**PHP skript pro hromadné smazání všech revizí :**

/—code php

\—

**Ev. v Myadminu jen SQL příkazem :**

/—code php
DELETE FROM wp_posts WHERE post_type=’revision‘
\—