wordpress 数据库_如何清理WordPress数据库以提高性能

wordpress 数据库

If you have been using WordPress for a while, then there is a good chance that you need to clean up your WordPress site. Doing regular clean ups allow you to reduce your database size which means quicker and smaller backup files. In this article, we will show you how to clean up WordPress database.

如果您已经使用WordPress一段时间,那么很有可能需要清理WordPress网站。 定期清理可以减少数据库大小,这意味着备份文件更快,更小。 在本文中,我们将向您展示如何清理WordPress数据库。

Cleaning up WordPress Database

As you use WordPress, your database accumulates a lot of extra data such as revisions, spam comments, trashed comments, data from plugins you are no longer using, and more. Removing all this unnecessary data can significantly reduce your database size which speeds up your backup process and can add minor performance improvements as well.

当您使用WordPress时,您的数据库会累积许多额外的数据,例如修订垃圾邮件注释 ,已删除注释,来自不再使用的插件的数据等等。 删除所有这些不必要的数据可以大大减少数据库的大小,从而加快备份过程,并且还可以改善性能。

Let’s take a look at how you can clean up your WordPress database.

让我们看一下如何清理WordPress数据库。

开始之前,请备份! (Before you start, Make a Backup!)

Before you do anything else, first create a complete WordPress backup of your site. Changes made by the clean up plugin are irreversible. Even though it does not directly mess with your posts or comments, its always better to be safe than sorry.

在执行其他任何操作之前,请先创建您网站的完整WordPress备份 。 清理插件所做的更改是不可逆的。 即使它不会直接与您的帖子或评论相提并论,但总比保证好起来要好。

影片教学 (Video Tutorial)

演示地址

If you don’t like the video or need more instructions, then continue reading.

如果您不喜欢该视频或需要更多说明,请继续阅读。

使用WP-Sweep清理您的WordPress数据库 (Cleaning up your WordPress Database with WP-Sweep)

First thing you need to do is install and activate the WP-Sweep plugin. Upon activation, simply go to Tools » Sweep to clean up your WordPress database.

您需要做的第一件事是安装并激活WP-Sweep插件 。 激活后,只需转到工具»扫描即可清理WordPress数据库。

WP-Sweep posts analysis

This plugin will analyze your WordPress database and show you a report of how much clutter you can clean. The sweep report is divided into different sections for your posts, comments, user meta, options, terms, and database optimize.

该插件将分析您的WordPress数据库,并向您显示可以清除多少杂物的报告。 扫描报告分为不同的部分,用于您的帖子,评论,用户元数据,选项,术语和数据库优化。

Cleaning up your comment meta and user meta data

You can go through items and clean them individually, or you can scroll down to the bottom of the page and click sweep all to clean up everything in your WordPress database.

您可以浏览并单独清理项目,也可以向下滚动到页面底部,然后单击“全部扫描”以清理WordPress数据库中的所有内容。

Cleaning up may take some time depending on how big your database is. WP-Sweep will show you the progress by updating the stats on the page.

清理可能需要一些时间,具体取决于数据库的大小。 WP-Sweep将通过更新页面上的统计信息向您显示进度。

为什么要进行WP扫描与WP优化? (Why WP-Sweep vs WP-Optimize?)

You may be wondering why are we writing about WP-Sweep when there is a very popular WP-Optimize plugin available that does nearly the same thing.

您可能想知道,为什么有一个非常流行的WP-Optimize插件可以完成几乎相同的工作,我们为什么还要写WP-Sweep。

Well that’s because it’s coded by a well-respected WordPress developer, Lester Chan.

那是因为它是由受人尊敬的WordPress开发人员Lester Chan编写的。

Also because the main distinguishing characteristic of WP-Sweep is that it uses proper WordPress delete functions as much as possible instead of running direct delete MySQL queries. Whereas the WP-Optimize plugin uses direct delete SQL queries which can leave orphaned data left behind.

同样是因为WP-Sweep的主要区别特征在于,它尽可能多地使用适当的WordPress删除功能,而不是运行直接删除MySQL查询。 而WP-Optimize插件使用直接删除SQL查询,这可能会留下孤立的数据。

Looking through WP-Optimize and they are using SQL query to delete post revisions which means there will be orphaned data left behind.

通过WP-Optimize查看,他们使用SQL查询删除帖子修订版本,这意味着将留下孤立的数据。

— Lester Chan (@gamerz) February 23, 2015

— Lester Chan(@gamerz) 2015年2月23日

In other words, WP-Sweep is a better coded plugin than WP-Optimize.

换句话说,WP-Sweep是比WP-Optimize更好的编码插件。

WP-Sweep清洁什么? (What all does WP-Sweep clean?)

WP-Sweep uses all the proper WordPress delete functions to clean up the database. At the time of writing this article, it can clean up the following:

WP-Sweep使用所有正确的WordPress删除功能来清理数据库。 在撰写本文时,它可以清除以下内容:

  • Revisions

    修订版
  • Auto drafts

    自动草稿
  • Deleted comments

    已删除的评论
  • Unapproved comments

    未经批准的评论
  • Spammed comments

    垃圾评论
  • Deleted comments

    已删除的评论
  • Orphaned post meta

    孤后元
  • Orphaned comment meta

    孤立评论元
  • Orphaned user meta

    孤立的用户元
  • Orphan term relationships

    孤儿条款关系
  • Unused terms

    未使用的条款
  • Duplicated post meta

    复制后的元
  • Duplicated comment meta

    重复的评论元
  • Duplicated user meta

    重复的用户元
  • Transient options

    瞬态选项
  • Optimizes database tables

    优化数据库表
  • oEmbed caches in post meta

    在后元中嵌入缓存

That’s all, we hope this article helped you clean your WordPress site using WP-Sweep. You may also want to check out our guide on the most common WordPress errors and how to fix them.

仅此而已,我们希望本文能帮助您使用WP-Sweep清理WordPress网站。 您可能还需要查看有关最常见的WordPress错误以及如何修复它们的指南。

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Google+.

如果您喜欢这篇文章,请订阅我们的YouTube频道 WordPress视频教程。 您也可以在TwitterGoogle+上找到我们。

翻译自: https://www.wpbeginner.com/plugins/how-to-clean-up-your-wordpress-database-for-improved-performance/

wordpress 数据库

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值