Warning: array_keys() expects parameter 1 to be array, null given in /www/wwwroot/help.cefhost.cn/wp-content/plugins/wp-synhighlight/geshi/geshi.php on line 1925
Warning: Invalid argument supplied for foreach() in /www/wwwroot/help.cefhost.cn/wp-content/plugins/wp-synhighlight/geshi/geshi.php on line 1925
Warning: Invalid argument supplied for foreach() in /www/wwwroot/help.cefhost.cn/wp-content/plugins/wp-synhighlight/geshi/geshi.php on line 2290
Warning: implode(): Argument must be an array in /www/wwwroot/help.cefhost.cn/wp-content/plugins/wp-synhighlight/geshi/geshi.php on line 3242
Warning: array_keys() expects parameter 1 to be array, null given in /www/wwwroot/help.cefhost.cn/wp-content/plugins/wp-synhighlight/geshi/geshi.php on line 3265
Warning: Invalid argument supplied for foreach() in /www/wwwroot/help.cefhost.cn/wp-content/plugins/wp-synhighlight/geshi/geshi.php on line 3265
Warning: Invalid argument supplied for foreach() in /www/wwwroot/help.cefhost.cn/wp-content/plugins/wp-synhighlight/geshi/geshi.php on line 3306
Warning: array_keys() expects parameter 1 to be array, null given in /www/wwwroot/help.cefhost.cn/wp-content/plugins/wp-synhighlight/geshi/geshi.php on line 3357
Warning: Invalid argument supplied for foreach() in /www/wwwroot/help.cefhost.cn/wp-content/plugins/wp-synhighlight/geshi/geshi.php on line 3357
Warning: array_keys() expects parameter 1 to be array, null given in /www/wwwroot/help.cefhost.cn/wp-content/plugins/wp-synhighlight/geshi/geshi.php on line 3502
Warning: Invalid argument supplied for foreach() in /www/wwwroot/help.cefhost.cn/wp-content/plugins/wp-synhighlight/geshi/geshi.php on line 3502
WordPress系统使用时间长了,数据库中的冗余数据就会很多,定期优化和清理Wordpress的数据库,可以保证Wordpress能够快速工作。
首先,停用一些无用的插件,将WordPress系统表之外的数据表都删除,只保留wp_posts, wp_comments, wp_terms, wp_term_relationships, wp_term_taxonomy 等系统数据表。
其次,打开phpMyadmin,通过SQL语句进行冗余数据删除操作。删除前记得先备份一下。
删除脚本是:
- DELETE FROM wp_posts WHERE post_type = 'revision';
- DELETE FROM wp_postmeta WHERE meta_key = '_edit_lock';
- DELETE FROM wp_postmeta WHERE meta_key = '_edit_last';
最后,在phpMyAdmin中,选中所有表,点“优化表”。
经过这一番优化操作,就可以将WordPress数据库中的冗余数据删除,优化了数据库的性能。