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

WordPressデータベースを初期設定に戻す方法

プラグインやテーマ、デモコンテンツが多すぎて、テストサイトがすっかり散らかってしまったことがありました。ひとつひとつ修正するのではなく、白紙に戻してやり直したかったのです。

そこでWordPressデータベースのリセットが便利です。すべてのコンテンツ、設定、カスタマイザーが即座に削除されるため、WordPressを再インストールする手間がかからず、インストールし直すことができます。

あなたが開発者であったり、さまざまなプラグインやテーマを試しているのであれば、これは非常に時間の節約になる。また、サイトを他の人に譲る前に片付けるのにも便利だ。

このガイドでは、プラグインを使ってWordPressデータベースを安全にリセットする方法をご紹介します。そうすれば、サイトへのアクセスを失ったり、重要なものを壊したりすることなく、新しいスタートを切ることができます。

Reset WordPress database to fresh install

このチュートリアルで説明するステップの概要を簡単に説明します:

なぜWordPressデータベースを初期設定に戻すのか?

新しいプラグインやテーマ、デザインのアイデアをテストするために、ローカルサーバーや ステージングサイトを使用することがよくあります。もしあなたが同じことをしているなら、WordPressのデータベースをリセットすることは大きな助けになります。

プロジェクト中、開発者サイトをダミーのコンテンツや設定でいっぱいにするのはよくあることだ。しばらくすると、すべてが山積みになり、物事が遅々として進まなくなる。

手作業ですべてを削除するのは面倒だし、何かを見逃してしまうのも簡単だ。散らかったテストサイトを片付けるのに、時間をかけすぎた経験は私たちにもある。

そのため、私たちはプラグインを使ってデータベースをすべて一度にリセットすることを好んでいます。その方が速く、簡単で、ストレスを感じることなく白紙に戻すことができます。

ステップ1:リセットの前にWordPressのバックアップを準備する💾。

WordPressは投稿やページからプラグインの設定まで、すべてをデータベースに保存しています。リセットすると、そのすべてが消去されます。

私たちは以前、バックアップのステップを飛ばして誤って仕事を失ったことがあります。⚠️ リセットは元に戻せないので、セーフティネットが必要です。

先に進む前にWordPressの完全なバックアップを作成することをお勧めします。データベースを保存したいだけであれば、データベースのバックアップだけでもかまいません。

方法1:Duplicatorを使ってWordPressデータベースをバックアップする

Duplicatorは、WordPressサイトを素早くバックアップする必要があるときに、私たちがよく使うツールです。Duplicatorは、私たちのバックアッププラグインラウンドアップでも紹介されています。

WPBeginnerと他のテストサイトで定期的に使用しています。バックアップを安全に保存し、個別クリックで簡単に復元できます。さらに詳しく知りたい方は、レビューをご覧ください。

開始するには、Duplicatorプラグインをインストールして有効化します。ヘルプが必要な場合は、プラグインのインストール方法のガイドに従ってください。

注: Duplicatorは無料版でも使えますが、スケジュールバックアップやクラウドストレージなどの高度な機能を利用したい場合は有料版をお勧めします。

有効化した後、ダッシュボードのDuplicator ” Backupsに移動し、’Add New’ボタンをクリックします。

Create a backup with Duplicator

バックアップに名前を付けましょう。Duplicatorでは、日付やサイト名などのダイナミックタグを使って自動的に作成することもできます。

準備ができたら、「次へ」ボタンをクリックして進みます。

Duplicator making a backup step 1

Duplicatorはあなたのサイトをスキャンし、結果の概要を表示します。セキュリティプラグインがないとか、WordPressのバージョンが古いとか、そういうことが表示されるかもしれません。

あなたのセットアップに当てはまらない場合は、無視してかまいません。問題がなければ、「バックアップを作成」ボタンをクリックします。

Create backup after scan is complete

バックアップが完了すると、Duplicatorはアーカイブファイルとインストーラファイルの両方のダウンロードオプションを表示します。

ダウンロード」をクリックし、「両方のファイル」を選択してコンピューターに保存します。

Download your backup files

これで完了です!WordPressデータベースが安全にバックアップされ、次のステップに進む準備が整いました。

方法2:Advanced WP Resetを使ってデータベースのバックアップを作成する

Advanced WP Resetプラグインを使用してWordPressサイトをリセットする予定がある場合は、最初にクイックデータベーススナップショットを作成するために使用することができます。

フルバックアップ・プラグインを必要としない小規模なテストサイトでは、この方法を使ったことがある。この方法は軽量で、仕事もこなします。

この方法を使用する場合、phpMyAdminを使用して手動でデータベースを復元する必要があります。難しいことではありませんが、Duplicatorを使用するよりも技術的です。

まず、Advanced WP Resetプラグインをインストールして有効化する。有効化したら、Tools ” Advanced WP Resetに行き、’Snapshots’タブをクリックする。

Make database backup with Snapshots tool

スナップショットに名前を付け、「スナップショットを撮る」ボタンを押します。一瞬で終わります。

プラグインはデータベースのバックアップを作成し、「利用可能なスナップショット」セクションに表示します。

Available snapshots

重要:スナップショットを保存せずにサイトをリセットすると、それも削除されます。次に進む前にダウンロードしてください。

プラス[+]アイコンをクリックしてスナップショットオプションを展開し、「ダウンロード」をクリックします。

Download backup file

バックアップは.sqlファイルとしてダウンロードされます。手動でデータベースをリストアする場合に必要になります。

ステップ2: WordPressデータベースを初期設定にリセットする 🔃。

WordPressデータベースをリセットするには、Advanced WP Resetプラグインが必要です。まだインストールしていない場合は、先にインストールしてください。必要であれば、プラグインのインストール方法のガイドに従ってください。

有効化したら、ツール ” アドバンスドWPリセットを開き、「リセット」タブをクリックする。

Items that will be deleted

ここでは、リセットを実行したときにプラグインが削除するすべてのもののリストが表示されます。これには以下が含まれます:

  • 投稿、ページ、コメントすべて
  • プラグインまたは手動で作成したカスタムデータベーステーブル
  • 現在の管理者以外のすべてのユーザーアカウント
  • スナップショットを含むAdvanced WP Resetのプラグインデータ

また、削除されないものも表示されます。これらは以下のようなものです:

  • 現在の管理ユーザーアカウント
  • アップロードされたファイル、テーマ、プラグイン(注:データベース内のプラグイン/テーマのデータは消去されます。)
  • サイトタイトル、タイムゾーン、言語などのWordPressの基本設定
  • 異なる接頭辞を持つWordPress以外のテーブル

問題がないようであれば、警告エリアまでスクロールダウンしてください。フィールドに「Reset」と入力し、「Reset」ボタンをクリックします。

Type reset to run the reset command

確認を求めるポップアップが表示されます。

今すぐリセット」をクリックして続けます。

Reset warning

プラグインはデータベースをリセットし、WordPressをクリーンな状態に戻します。

完了すると、リセットが完了したことを確認する成功メッセージが表示されます。

WordPress database reset finished

これで初期設定のWordPressデータベースを使ってサイトを新しく始めることができます。

注意リセットの後、WordPressは初期設定のサンプルコンテンツを再び追加します。これには’Hello World’投稿、サンプルページ、コメントが含まれます。お望みであれば、これらを手動で削除することができます。

ステップ3:バックアップからWordPressデータベースを復元する(オプション)

WordPressデータベースのリセットが計画通りにいかなかった場合でも、心配はいりません。以前に作成したバックアップを復元することで、元に戻すことができます。

方法1:Duplicatorデータベースバックアップを復元する

サイトのバックアップにDuplicatorプラグインを使用した場合、安全にサイトを復元する方法をご紹介します。

リセット後、Advanced WP Resetプラグインはすべてのプラグインを無効化します。そのため、まずダッシュボードのプラグインページに行き、Duplicatorを再度有効にしてください。

Activate Duplicator plugin

有効化したら、Duplicator ” バックアップのインポートに進みます。

最初にバックアップを作成したときにダウンロードしたアーカイブファイルをアップロードします。

Duplicator import

Duplicatorはアーカイブをスキャンし、バックアップの詳細を表示します。

問題がなければ「Continue」ボタンをクリックする。

Import ready

回復ポイントを作成せずに続行するかどうかを尋ねられることがあります。

すでにバックアップがあるのだから、このまま続けても大丈夫だ。

Recovery point confirmation

下にスクロールすると、コンテンツの概要が表示されます。

インストーラの起動」をクリックして先に進みます。

Launch installer

Duplicatorインストーラが起動します。

インポートの種類として「個別サイトの復元」が自動的に選択されます。

Restoration type

検証セクションまでスクロールする。

次に、利用規約と注意事項を読んだことを確認するボックスにチェックを入れてください。

Accept terms and notices

次へ」をクリックして復元プロセスを開始する必要があります。

Duplicatorは選択した設定の確認ポップアップを表示します。OK」をクリックしてください。

Confirm installation settings

プラグインはバックアップの復元と元のデータベースのインポートを開始します。

完了すると、成功メッセージが表示され、WordPress管理エリアにログインし直すオプションが表示されます。

Import finished

方法2:SQLファイルからデータベースバックアップを復元する

Advanced WP Resetプラグインのスナップショットツールを使用した場合、バックアップはSQLファイルとして保存されます。ここでは、phpMyAdminまたは同様のデータベースツールを使用して復元する方法を説明します。

まずはphpMyAdminを開きましょう。これはウェブベースのアプリケーションで、シンプルなインターフェースでデータベースを管理できます。

サイトをオンラインでホスティングしている場合は、WordPressホスティングコントロールパネル(通常はcPanel)にログインします。

データベースセクションを探し、’phpMyAdmin’オプションをクリックします。

Launch phpMyAdmin

新しいブラウザータブでphpMyAdminが開きます。

ローカルで作業している場合は、phpMyAdminまたはローカルサイトのセットアップに付属しているデータベースツールを開いてください。

WordPressのローカル開発にはLocalの使用をお勧めします。phpMyAdminは含まれていませんが、代わりにOpen Adminerを使用します。

Open Adminer

phpMyAdminに入ったら、左サイドバーからWordPressデータベースを選択します。

下にスクロールし、’Check all’をクリックしてすべてのテーブルを選択し、ドロップダウンから’Drop’を選択して削除する。

Drop tables

これで現在のデータベースが消去され、バックアップをインポートできるようになります。

次に、上部にある「インポート」タブに切り替え、「ファイルを選択」ボタンをクリックして保存したSQLファイルをアップロードします。

Import SQL file

ほとんどのサイトでは初期設定のままでよい。通常は問題なく動作します。

下にスクロールし、「インポート」ボタンをクリックしてプロセスを実行する。

Run import

phpMyAdminがSQLファイルをアップロードして実行します。これは通常数秒しかかかりません。

完了すると、画面上部に成功のメッセージが表示されます。

SQL file imported

これでサイトにアクセスしてログインできます。WordPressデータベースはリセット前の状態に戻っているはずです。

🛠️専門家によるメンテナンスでWordPressサイトのスムーズな運営を維持します!

データベースのリセット、更新、バックアップ、セキュリティチェックでお困りですか?WordPressメンテナンスサービスは、お客様のサイトを常に最高の状態に保ち、時間と手間を節約します。

今すぐWordPressのプロフェッショナルなメンテナンスをご利用ください!

WordPressデータベースに関するその他のリソース

サイトのリセットと復元に慣れてきたら、WordPressのデータベースが裏でどのように動いているのか、さらに詳しく学ぶとよいでしょう。時間の節約やミスの防止、問題の迅速な解決に役立ちます。

ここでは、WordPressデータベースを理解し、自信を持って管理するために役立つガイドをいくつかご紹介します:

WordPressデータベースを初期設定にリセットする方法について、この投稿がお役に立てば幸いです。また、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 Facebook.

Disclosure: Our content is reader-supported. This means if you click on some of our links, then we may earn a commission. See how WPBeginner is funded, why it matters, and how you can support us. Here's our editorial process.

アバター

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.

The Ultimate WordPress Toolkit

Get FREE access to our toolkit - a collection of WordPress related products and resources that every professional should have!

Reader Interactions

45件のコメントLeave a Reply

  1. A Owadud Bhuiyan

    I have heard that our database will automatically take back up from our hosting.

    How do I find out where is my database backup file?

    • WPBeginner Support

      It would depend on your hosting provider for if they do that and where the backup would be located. If you reach out to your host they should be able to let you know!

      Admin

    • Jiří Vaněk

      It’s different for every provider. Backups are usually available in an FTP folder, which is embedded there as a symlink to the backup server. Another option is in the form of a control panel, which is available for the website (but does not have to be). Another possibility is that backups are available from the service administration of your web hosting provider. And the last option is on request. This means that backups are not available, but the provider will provide them to you upon request, or, if it is better and has excellent customer support, it can restore the database directly from the backup. It’s more of a web provider question.

  2. Konrad

    Thanks for simplyfing the process, it may come in handy someday. Also remember that backup is crucial!

    • WPBeginner Support

      Creating a backup in case it is needed is very important.

      Admin

  3. THANKGOD JONATHAN

    Please if I choose to use the ADVANCE WP RESET plugins to backup my database, can I still use it to restore the database? Because I didn’t hear you mention it.
    And secondly please, if for instance I thing my wordpress site has been compromised can I use this method to remove the maliciouse codes?
    Thank you for considering this question.

  4. Jiří Vaněk

    Isn’t it easier to delete the database content through PHPmyAdmin? After calling the domain or localhost, a reinstallation will take place, and everything should be reset. The data on FTP will remain, including the folder with plugins, which can simply be activated if necessary.

    Backup DB can be done also in PHPmyAdmin.

    • WPBeginner Support

      If you are comfortable with using the editing interface then you can use phpmyadmin’s interface but for most beginner users we would recommend the route from our article to prevent accidental deletion of something that they would want to keep :)

      Admin

  5. Jackson

    Wow, thank you so much!
    You saved the life of my fingernails and allot of frustration!

    • WPBeginner Support

      Glad our guide could help :)

      Admin

  6. dai

    hi there.. i see i face same issue as many others here.
    since i resat it all..i have and error while trying to get to my wordpress page : “Sorry, you are not allowed to access this page.”

    how to fix it up ???
    thanks.

  7. maurice

    hey I wonder if I have a subdomain such as test.example.com and i reset the whole db with this tool. Will the DB for example.com stay untouched or will this also be resetted?
    Want to reset just the testpage so I can check a new theme but want to leave the live page untouched…
    thx

    • WPBeginner Support

      Hey Maurice,

      They will remain untouched. But as a precaution you should always create complete database backups before performing any operations on your WordPress database. It is also recommended that you use different database for each WordPress website.

      Admin

  8. Villy

    I used the database reset on my site , and now I can’t log in. I think it’s because I deleted the wP-users file. I tried to change passwords but didn’t receive an email. How do I fix this..

    • Latha

      How to get rid of your problem.Bcoz still I’m facing that problem:(

  9. Joe

    My wordpress post didnt show date and time and cant change the site timezone, can it solve my problem?

    • WPBeginner Support

      We can’t say that it would. First, you should try to find out why you are unable to change the site timezone. Time settings can be found on Settings » General page inside WordPress admin area. You may also want to try these WordPress troubleshooting tips first.

      Admin

  10. Nathan

    I used this plugin-in and after I reset everything, my site no longer exist. How do I get it back? I can’t get into my admin permissions.

  11. Gozie Prosper

    What option can i select so as to reset my WordPress without loosing my users, my plugins and my pages. Even if I loose my themes, I have no issue with it.

    Thanks a lot

      • Gozie Prosper

        Please guide me on the tables I can select using this plugging and reset large part of my data base without loosing my pages and plugins only.

        Thanks

      • Gozie Prosper

        please guide me on which tables to select in the list of tables as the pluggin displays which when selected will reset large parts of my WordPress site without resetting my pages.

  12. Jan

    Will this delete original blog posts on WordPress? I want to get rid of my duplicates but I do not want to lose my work :(

    • WPBeginner Support

      It will delete all your blog posts. You will have an empty WordPress site with clean DB.

      Admin

  13. Louise

    After reading reams of information which might as well have been written in a foreign language, I came across this and it solved my problem beautifully. Thank you.

  14. Asim Khan

    Hi i have a problem that when i go to add new post my HTML and Text buttons are hidden and i cannot type my text so plz help me

  15. Mohammed

    I have reset the wordpress. But now i cant visit my site iam worried if i click on my site its coming white empty pls help

  16. Special

    Apparently I am a complete idot and I just wiped my clients entire website. Nope, apparently not smart enough to create a back and it is due next week. First big project…I need help….ASAP!!!

  17. hass annac

    Thank you for this tip, save me time and hassle.

    Thank you

  18. Gerrit Smit

    I have users reset with the plugin, now I can not login to wordpress.

    I get message
    “” You do not have enough rights for this page ‘

    Who can help me please

    thanx

  19. Gerrit Smit

    for me is unable to login, what did i do wrong

  20. Muhammad Amir

    it worked .. but once signed out ..unable to login its nt accepting my current password or the 1st one :( ..

    • Villy

      How did you resolve this

  21. Joe

    If this works you’re a lifesaver! Thanks.

  22. Joe

    Is there a plugin/way to delete all content on a site but keep themes and plugins intact?

    Thanks.

    • WPBeginner Support

      You can go to phpmyAdmin and empty your database tables. Keep a backup in case you want to revert back.

      Admin

  23. Luke

    Thanks a lot. I was doing my head in over my messed up site. Time to start again!
    Big help

  24. stacy

    Any chance this can be run from a cron job so it’s automated? I’m trying to setup a demo site and would like the content to be reset once an hour.

    On that note, any ideas on how to get the wordpress site to also delete any new images that were uploaded during that time?

    Thanks for your help!

  25. Joseph

    Hi, really cool post but I do have a question…will this affect my themes? I have some premium themes i don’t want to lose.

  26. jim

    AMAZING, thank you so much, solved my problem when i pretty much ruined my wp.

  27. Zaadu

    Thanks for this! All the times before I used to make changes to the db and make anew install of wordpress…No more from now on

  28. namaserajesh

    Useful plugin for me, I’m using WordPress on localhost so It’ll help me to reset database to default settings.

Leave A Reply

Thanks for choosing to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and your email address will NOT be published. Please Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.