Trusted WordPress tutorials, when you need them most.
Beginner’s Guide to WordPress
WPBカップ
25 Million+
Websites using our plugins
16+
Years of WordPress experience
3000+
WordPress tutorials
by experts

WordPressデータベースをクリーンアップしてパフォーマンスを向上させる方法

編集メモ: WPBeginner のパートナーリンクから手数料を得ています。手数料は編集者の意見や評価に影響を与えません。編集プロセスについて詳しく知る。

WordPressをしばらく使用している場合、WordPressサイトをクリーンアップする必要がある可能性が高いです。定期的にクリーンアップを行うことで、データベースのサイズを小さくすることができ、バックアップファイルをより早く、より小さくすることができます。この投稿では、WordPressのデータベースをクリーンアップする方法を紹介します。

Cleaning up WordPress Database

WordPressを使っていると、データベースにはリビジョンスパムコメント、ゴミ箱内のコメント、使わなくなったプラグインのデータなど、多くの余分なデータが蓄積されていきます。このような不要なデータをすべて削除することで、データベースのサイズを大幅に縮小することができ、バックアッププロセスを高速化し、パフォーマンスも少し向上させることができます。

WordPressデータベースをクリーンアップする方法を見てみましょう。

始める前に、バックアップを取りましょう!

他のことをする前に、まずサイトのWordPressの完全なバックアップを作成してください。クリーンアッププラグインによる変更は元に戻りません。投稿やコメントに直接手を加えるわけではありませんが、転ばぬ先の杖です。

動画チュートリアル

Subscribe to WPBeginner

動画が気に入らなかったり、もっと説明が必要な場合は、このまま読み進めてください。

WP-SweepでWordPressデータベースをクリーンアップする

最初に行う必要があるのは、WP-Sweepプラグインをインストールして有効化することです。有効化したら、Tools ” SweepでWordPressデータベースをクリーンアップします。

WP-Sweep posts analysis

このプラグインはWordPressのデータベースを分析し、どれだけきれいにできるかレポートを表示します。スイープレポートは、投稿、コメント、ユーザーメタ情報、オプション、キーワード、データベースの最適化のための異なるセクションに区切られています。

Cleaning up your comment meta and user meta data

項目を見て個別に掃除することもできますし、ページの一番下までスクロールして、WordPressデータベースのすべてを掃除するためにすべてを掃除するをクリックすることもできます。

データベースの大きさによっては、クリーンアップに時間がかかる場合があります。WP-Sweepはページ上の統計情報を更新することで進捗状況を表示します。

なぜWP-SweepとWP-Optimizeの比較?

WP-SweepとWP-Optimizeはほとんど同じ機能を持つプラグインです。

それは、このプラグインが有名なWordPress開発者、レスター・チャンによってコード化されているからです。

また、WP-Sweepの主な特徴は、MySQLの直接削除クエリーを実行する代わりに、WordPressの適切な削除関数をできるだけ使用することです。一方、WP-Optimizeプラグインは、直接削除SQLクエリーを使用するため、データが取り残される可能性があります。

言い換えれば、WP-SweepはWP-Optimizeよりも優れたプラグインです。

WP-Sweepはすべてきれいにしてくれるのか?

WP-SweepはデータベースをクリーンアップするためにWordPressの適切な削除関数をすべて使用します。この投稿の時点では、以下のものをクリーンアップできます:

  • リビジョン
  • 自動下書き
  • 削除されたコメント
  • 未承認コメント
  • コメントするスパム
  • 削除されたコメント
  • 孤立投稿メタ情報
  • 孤立したコメントメタ情報
  • 孤立したユーザーメタ情報
  • 孤児のキーワード関係
  • 未使用のキーワード
  • 投稿メタ情報の重複
  • 重複するコメントメタ情報
  • 重複したユーザーメタ情報
  • 一時的オプション
  • データベーステーブルの最適化
  • 投稿メタ情報にキャッシュを埋め込む

すべて、この投稿がWP-Sweepを使用してWordPressサイトをきれいにするのに役立ったことを願っています。最も一般的なWordPressエラーとその修正方法についてのガイドもご覧ください。

この投稿を気に入っていただけたなら、WordPress動画チュートリアルのYouTubeチャンネルをご購読ください。Twitterや Google+でもご覧いただけます。

情報開示 私たちのコンテンツは読者支援型です。これは、あなたが私たちのリンクの一部をクリックした場合、私たちはコミッションを得ることができることを意味します。 WPBeginnerの資金源 をご覧ください。3$編集プロセスをご覧ください。

Avatar

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi with over 16 years of experience in WordPress, Web Hosting, eCommerce, SEO, and Marketing. Started in 2009, WPBeginner is now the largest free WordPress resource site in the industry and is often referred to as the Wikipedia for WordPress.

究極のWordPressツールキット

ツールキットへの無料アクセス - すべてのプロフェッショナルが持つべきWordPress関連製品とリソースのコレクション!

Reader Interactions

28件のコメント返信を残す

  1. Syed Balkhi says

    Hey WPBeginner readers,
    Did you know you can win exciting prizes by commenting on WPBeginner?
    Every month, our top blog commenters will win HUGE rewards, including premium WordPress plugin licenses and cash prizes.
    You can get more details about the contest from here.
    Start sharing your thoughts below to stand a chance to win!

  2. Sally G. says

    In terms of comments, does Empty Spam and Empty Trash do the same thing as this plug-in? I can certainly see where it would be useful for earlier revisions to a post, etc.

    • WPBeginner Support says

      For sites just starting out it would be the same but as a site grows it can clean up information from comments that were deleted and a few other things :)

      管理者

  3. Nivesh Gandhi says

    Both are great plug ins. Normally you don’t even need to do backup. But its always good to be on safe side.

  4. Dave says

    WP Sweep – what a plugin. I have a WP site that hadn’t had much love over the past 18 months and somehow had a 1.4Gb DB. Worryingly WP Sweep managed to reduce that to just over 17MB.

    More investigation needed.

  5. Francis says

    Hello , i have a question. Im using godaddy managed wordpress . They have a staging site. Can i use the staging site to clean up database then , push it to live production site after. Will it clean my database. Thanks

  6. Mike Patterson says

    Thank you for the useful information on cleaning WordPress Site. This helps me a lot as my site is getting bulky and take a lot of time to get load.

  7. Ramon says

    Looked promissing but I’m not sure about the result. I had about 2600 revisions.. hoped cleaning them would make a difference but it didn’t, at least not in database size, might even be bigger now .. about 800MB.. What options are there to compact database if cleaning up doesn’t help?

    By the way: looked like wp-sweep locked up a couple of times.. after refesh I noticed that the numbers were decreased and I started again, and again, and again till all revisions where removed. Can’t say I’m excited about wp-sweep but maybe I used it wrong, is that possible?

  8. Ahmed says

    Very nice post!
    Cleaning database is very usefull especially for large ones.
    I have used the Advanced Database Cleaner, it is also very powerful and provides many features such as scheduling the cleaning of database and more…

  9. Chris says

    I really enjoyed this article, the layout, and the links. I really just had to say I appreciate the 50 second video that quickly and easily explained what to do and the lead in of backing up your site with a quick little article to find a backup service. I’m new to WP and blogging but trying to learn fast and after viewing this page I can tell I’m going to be spending a lot of time on your site! Well done and thanks!

  10. Anna says

    I had wp optimize on my “to install” list, but after seeing this post I downloaded WP sweep. it’s so easy to use. I usually clean up my spam comments, but I know that I have a lot of revisions on my posts so it’s good to get rid of those!

  11. Bhongo says

    yet another great article. Good job guys, I have never thought about about a database clean-up for my WP sites but now thanks to you, I will be doing a clean-up ASAP.

  12. Nikky says

    We’ve been using Wp-Optimize plugin and it works great with similar options to the plugin mentioned above. What you suggest Wp-Optimize or WP-Sweep ?

  13. KennyTheMap says

    Certainly cleaned up a lot of trash from my main website.
    Like Broken Link Checker it is a really useful plugin.

    A question; I deactivate such plugins until I next need to use them as I gather that can improve performance. Is my assumption correct?

    Thanks, Kenny

    • WPBeginner Support says

      Properly coded plugins will not affect your site’s performance when you are not using them. But there can be plugins that will add additional style sheets or JavaScript even if you are not using them. So it is best to deactivate the plugins you are not using.

      管理者

  14. Marcelo says

    Whoa! I’ll be switching almost right now, unless the author of WP-Optimize upgrade its plugin this week :)

  15. Dave says

    I agree! I have used a bunch of tools for this purpose before, with mostly good results. But this plugin is SO much easier to use, and really did a great job of cleaning.

    Of course, some people won’t heed the clear warning to back up first, but that’s human nature, I suppose. :)

    A super job by Lester Chan, an under-appreciated outstanding coder and contributor to WordPress!

    Dave

  16. Kenneth Adair says

    I deleted the wp-optimize and added the wp-sweep but where does one see what the database size is before and after sweeping?

    • Marcelo says

      That’s the thing with this Sweep plugin. Its author wants things clear, simple, and minimalistic. But I think the UI for such a critical tool like a database cleaning, should be more detailed.
      Also, the lack of a scheduling feature will make it pass unnoticed.

      I think the best approach would be if Ruhani Rabin could upgrade its own and well known plugin to use official, native, WP queries to the cleaning. I will ask him what does he think about it.
      https://github.com/ruhanirabin/WP-Optimize/issues/60

      Lester Chan is a great programmer, but I wouldn’t like to abandon WP-Optimize because of the approach.

      What do you think guys?

      Best regards

返信を残す

コメントありがとうございます。すべてのコメントは私たちのコメントポリシーに従ってモデレートされ、あなたのメールアドレスが公開されることはありませんのでご留意ください。名前欄にキーワードを使用しないでください。個人的で有意義な会話をしましょう。