プラグインやテーマ、デモコンテンツが多すぎて、テストサイトがすっかり散らかってしまったことがありました。ひとつひとつ修正するのではなく、白紙に戻してやり直したかったのです。
そこでWordPressデータベースのリセットが便利です。すべてのコンテンツ、設定、カスタマイザーが即座に削除されるため、WordPressを再インストールする手間がかからず、インストールし直すことができます。
あなたが開発者であったり、さまざまなプラグインやテーマを試しているのであれば、これは非常に時間の節約になる。また、サイトを他の人に譲る前に片付けるのにも便利だ。
このガイドでは、プラグインを使ってWordPressデータベースを安全にリセットする方法をご紹介します。そうすれば、サイトへのアクセスを失ったり、重要なものを壊したりすることなく、新しいスタートを切ることができます。

このチュートリアルで説明するステップの概要を簡単に説明します:
なぜWordPressデータベースを初期設定に戻すのか?
新しいプラグインやテーマ、デザインのアイデアをテストするために、ローカルサーバーや ステージングサイトを使用することがよくあります。もしあなたが同じことをしているなら、WordPressのデータベースをリセットすることは大きな助けになります。
プロジェクト中、開発者サイトをダミーのコンテンツや設定でいっぱいにするのはよくあることだ。しばらくすると、すべてが山積みになり、物事が遅々として進まなくなる。
手作業ですべてを削除するのは面倒だし、何かを見逃してしまうのも簡単だ。散らかったテストサイトを片付けるのに、時間をかけすぎた経験は私たちにもある。
そのため、私たちはプラグインを使ってデータベースをすべて一度にリセットすることを好んでいます。その方が速く、簡単で、ストレスを感じることなく白紙に戻すことができます。
ステップ1:リセットの前にWordPressのバックアップを準備する💾。
WordPressは投稿やページからプラグインの設定まで、すべてをデータベースに保存しています。リセットすると、そのすべてが消去されます。
私たちは以前、バックアップのステップを飛ばして誤って仕事を失ったことがあります。⚠️ リセットは元に戻せないので、セーフティネットが必要です。
先に進む前にWordPressの完全なバックアップを作成することをお勧めします。データベースを保存したいだけであれば、データベースのバックアップだけでもかまいません。
方法1:Duplicatorを使ってWordPressデータベースをバックアップする
Duplicatorは、WordPressサイトを素早くバックアップする必要があるときに、私たちがよく使うツールです。Duplicatorは、私たちのバックアッププラグインラウンドアップでも紹介されています。
WPBeginnerと他のテストサイトで定期的に使用しています。バックアップを安全に保存し、個別クリックで簡単に復元できます。さらに詳しく知りたい方は、レビューをご覧ください。
開始するには、Duplicatorプラグインをインストールして有効化します。ヘルプが必要な場合は、プラグインのインストール方法のガイドに従ってください。
注: Duplicatorは無料版でも使えますが、スケジュールバックアップやクラウドストレージなどの高度な機能を利用したい場合は有料版をお勧めします。
有効化した後、ダッシュボードのDuplicator ” Backupsに移動し、’Add New’ボタンをクリックします。

バックアップに名前を付けましょう。Duplicatorでは、日付やサイト名などのダイナミックタグを使って自動的に作成することもできます。
準備ができたら、「次へ」ボタンをクリックして進みます。

Duplicatorはあなたのサイトをスキャンし、結果の概要を表示します。セキュリティプラグインがないとか、WordPressのバージョンが古いとか、そういうことが表示されるかもしれません。
あなたのセットアップに当てはまらない場合は、無視してかまいません。問題がなければ、「バックアップを作成」ボタンをクリックします。

バックアップが完了すると、Duplicatorはアーカイブファイルとインストーラファイルの両方のダウンロードオプションを表示します。
ダウンロード」をクリックし、「両方のファイル」を選択してコンピューターに保存します。

これで完了です!WordPressデータベースが安全にバックアップされ、次のステップに進む準備が整いました。
方法2:Advanced WP Resetを使ってデータベースのバックアップを作成する
Advanced WP Resetプラグインを使用してWordPressサイトをリセットする予定がある場合は、最初にクイックデータベーススナップショットを作成するために使用することができます。
フルバックアップ・プラグインを必要としない小規模なテストサイトでは、この方法を使ったことがある。この方法は軽量で、仕事もこなします。
この方法を使用する場合、phpMyAdminを使用して手動でデータベースを復元する必要があります。難しいことではありませんが、Duplicatorを使用するよりも技術的です。
まず、Advanced WP Resetプラグインをインストールして有効化する。有効化したら、Tools ” Advanced WP Resetに行き、’Snapshots’タブをクリックする。

スナップショットに名前を付け、「スナップショットを撮る」ボタンを押します。一瞬で終わります。
プラグインはデータベースのバックアップを作成し、「利用可能なスナップショット」セクションに表示します。

重要:スナップショットを保存せずにサイトをリセットすると、それも削除されます。次に進む前にダウンロードしてください。
プラス[+]アイコンをクリックしてスナップショットオプションを展開し、「ダウンロード」をクリックします。

バックアップは.sql
ファイルとしてダウンロードされます。手動でデータベースをリストアする場合に必要になります。
ステップ2: WordPressデータベースを初期設定にリセットする 🔃。
WordPressデータベースをリセットするには、Advanced WP Resetプラグインが必要です。まだインストールしていない場合は、先にインストールしてください。必要であれば、プラグインのインストール方法のガイドに従ってください。
有効化したら、ツール ” アドバンスドWPリセットを開き、「リセット」タブをクリックする。

ここでは、リセットを実行したときにプラグインが削除するすべてのもののリストが表示されます。これには以下が含まれます:
- 投稿、ページ、コメントすべて
- プラグインまたは手動で作成したカスタムデータベーステーブル
- 現在の管理者以外のすべてのユーザーアカウント
- スナップショットを含むAdvanced WP Resetのプラグインデータ
また、削除されないものも表示されます。これらは以下のようなものです:
- 現在の管理ユーザーアカウント
- アップロードされたファイル、テーマ、プラグイン(注:データベース内のプラグイン/テーマのデータは消去されます。)
- サイトタイトル、タイムゾーン、言語などのWordPressの基本設定
- 異なる接頭辞を持つWordPress以外のテーブル
問題がないようであれば、警告エリアまでスクロールダウンしてください。フィールドに「Reset」と入力し、「Reset」ボタンをクリックします。

確認を求めるポップアップが表示されます。
今すぐリセット」をクリックして続けます。

プラグインはデータベースをリセットし、WordPressをクリーンな状態に戻します。
完了すると、リセットが完了したことを確認する成功メッセージが表示されます。

これで初期設定のWordPressデータベースを使ってサイトを新しく始めることができます。
注意:リセットの後、WordPressは初期設定のサンプルコンテンツを再び追加します。これには’Hello World’投稿、サンプルページ、コメントが含まれます。お望みであれば、これらを手動で削除することができます。
ステップ3:バックアップからWordPressデータベースを復元する(オプション)
WordPressデータベースのリセットが計画通りにいかなかった場合でも、心配はいりません。以前に作成したバックアップを復元することで、元に戻すことができます。
方法1:Duplicatorデータベースバックアップを復元する
サイトのバックアップにDuplicatorプラグインを使用した場合、安全にサイトを復元する方法をご紹介します。
リセット後、Advanced WP Resetプラグインはすべてのプラグインを無効化します。そのため、まずダッシュボードのプラグインページに行き、Duplicatorを再度有効にしてください。

有効化したら、Duplicator ” バックアップのインポートに進みます。
最初にバックアップを作成したときにダウンロードしたアーカイブファイルをアップロードします。

Duplicatorはアーカイブをスキャンし、バックアップの詳細を表示します。
問題がなければ「Continue」ボタンをクリックする。

回復ポイントを作成せずに続行するかどうかを尋ねられることがあります。
すでにバックアップがあるのだから、このまま続けても大丈夫だ。

下にスクロールすると、コンテンツの概要が表示されます。
インストーラの起動」をクリックして先に進みます。

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

検証セクションまでスクロールする。
次に、利用規約と注意事項を読んだことを確認するボックスにチェックを入れてください。

次へ」をクリックして復元プロセスを開始する必要があります。
Duplicatorは選択した設定の確認ポップアップを表示します。OK」をクリックしてください。

プラグインはバックアップの復元と元のデータベースのインポートを開始します。
完了すると、成功メッセージが表示され、WordPress管理エリアにログインし直すオプションが表示されます。

方法2:SQLファイルからデータベースバックアップを復元する
Advanced WP Resetプラグインのスナップショットツールを使用した場合、バックアップはSQLファイルとして保存されます。ここでは、phpMyAdminまたは同様のデータベースツールを使用して復元する方法を説明します。
まずはphpMyAdminを開きましょう。これはウェブベースのアプリケーションで、シンプルなインターフェースでデータベースを管理できます。
サイトをオンラインでホスティングしている場合は、WordPressホスティングコントロールパネル(通常はcPanel)にログインします。
データベースセクションを探し、’phpMyAdmin’オプションをクリックします。

新しいブラウザータブでphpMyAdminが開きます。
ローカルで作業している場合は、phpMyAdminまたはローカルサイトのセットアップに付属しているデータベースツールを開いてください。
WordPressのローカル開発にはLocalの使用をお勧めします。phpMyAdminは含まれていませんが、代わりにOpen Adminerを使用します。

phpMyAdminに入ったら、左サイドバーからWordPressデータベースを選択します。
下にスクロールし、’Check all’をクリックしてすべてのテーブルを選択し、ドロップダウンから’Drop’を選択して削除する。

これで現在のデータベースが消去され、バックアップをインポートできるようになります。
次に、上部にある「インポート」タブに切り替え、「ファイルを選択」ボタンをクリックして保存したSQLファイルをアップロードします。

ほとんどのサイトでは初期設定のままでよい。通常は問題なく動作します。
下にスクロールし、「インポート」ボタンをクリックしてプロセスを実行する。

phpMyAdminがSQLファイルをアップロードして実行します。これは通常数秒しかかかりません。
完了すると、画面上部に成功のメッセージが表示されます。

これでサイトにアクセスしてログインできます。WordPressデータベースはリセット前の状態に戻っているはずです。
🛠️専門家によるメンテナンスでWordPressサイトのスムーズな運営を維持します!
データベースのリセット、更新、バックアップ、セキュリティチェックでお困りですか?WordPressメンテナンスサービスは、お客様のサイトを常に最高の状態に保ち、時間と手間を節約します。
WordPressデータベースに関するその他のリソース
サイトのリセットと復元に慣れてきたら、WordPressのデータベースが裏でどのように動いているのか、さらに詳しく学ぶとよいでしょう。時間の節約やミスの防止、問題の迅速な解決に役立ちます。
ここでは、WordPressデータベースを理解し、自信を持って管理するために役立つガイドをいくつかご紹介します:
- phpMyAdminによる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.
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.
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
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.
WPBeginner Support
The plugin has recently added a way to restore your backup created with the plugin.
For a hacked WordPress site, we would recommend taking a look at our article below
https://www.wpbeginner.com/beginners-guide/beginners-step-step-guide-fixing-hacked-wordpress-site/
Admin
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
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
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.
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
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:(
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
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.
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
WPBeginner Support
Your WordPress database contains all your data like posts, pages, comments, users, etc. Make sure you backup your WordPress database. You also need to backup your plugins folder.
Admin
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.
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
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.
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
WPBeginner Support
Please see how to fix white text and missing buttons in WordPress visual editor.
Admin
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
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!!!
hass annac
Thank you for this tip, save me time and hassle.
Thank you
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
Gerrit Smit
for me is unable to login, what did i do wrong
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
Joe
If this works you’re a lifesaver! Thanks.
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
Luke
Thanks a lot. I was doing my head in over my messed up site. Time to start again!
Big help
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!
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.
Editorial Staff
Yes it will.
Admin
jim
AMAZING, thank you so much, solved my problem when i pretty much ruined my wp.
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
namaserajesh
Useful plugin for me, I’m using WordPress on localhost so It’ll help me to reset database to default settings.