WordPressサイトに重大なエラーが表示されていませんか?
WordPressでは、「このサイトで重大なエラーが発生しました。サイト管理者の受信トレイで指示を確認してください。WordPressのデバッグガイドへのリンクも表示されます。
このガイドでは、WordPressの重大なエラーを修正する方法を紹介します。また、このエラーの原因と回避方法についても説明します。
WordPressのクリティカルエラーとは?
WordPressのクリティカルエラーとは、WordPressが正しく動作するために必要なスクリプトをすべて読み込めなくなるエラーのことです。
以前は、このWordPressエラーは 死の白い画面や致命的なエラーメッセージが画面に表示されていました。ほとんどの初心者はあまり役に立たず、自分で問題を解決しようと悪戦苦闘していました。
WordPress 5.2以降、ユーザーには一般的なエラーメッセージが表示されるようになりました:このサイトで重大なエラーが発生しました。サイト管理者のメール受信トレイで指示を確認してください」という一般的なエラーメッセージと、WordPress デバッグガイドへのリンクが表示されます。
また、WordPressサイトの管理者メールアドレスにメールを送信します。
このメールには、エラーの原因となっているプラグインやテーマの詳細と、リカバリーモードでWordPressダッシュボードにアクセスするためのリンクが含まれています。
このエラーの別の種類は、あなたのサイトが重大なエラーに直面していることを示すだけです。メールアドレスを確認するように指示することはありません。
これは、WordPressがリカバリーモードを使用可能にしたり、メールを送信したりするために必要なファイルをロードできなかったために起こる可能性があります。
WordPressのクリティカルエラーの原因は?
WordPressのクリティカルエラーは、一般的にプラグイン、スクリプト、またはWordPressが正しく機能しないコードの誤動作が原因で発生します。
コードの誤動作により、WordPressは必要なファイルを読み込むことができません。
チュートリアルのコードスニペットをコピー&ペーストしてサイトに貼り付けた場合、重大なエラーが発生する可能性があります。
WordPressのトッププラグインはすべて徹底的にテストされているため、重大なエラーを引き起こす可能性は低くなっています。しかし、他のWordPressプラグインとの競合やカスタマイザーコードがエラーの引き金になることがあります。
WordPressの重大なエラーを修正し、サイトを取り戻す方法を見てみましょう。
WordPressのクリティカルエラーを修正する(2つの方法)
致命的なエラーメッセージそのものは、問題の原因を見つけて修正するのにはあまり役に立ちません。幸いなことに、WordPressはサイトの管理者メールアドレスにもメールを送信します。
多くのWordPressサイトは、SMTPを使用してメールを送信するように設定されていません。このため、WordPressがメールを送信したと伝えているにもかかわらず、メールが届かないことがあります。
同様に、WordPressサイトによっては、メールを確認する指示なしに重大なエラーメッセージだけが表示されることがあります。これは、WordPressがメールを送信するために必要なファイルをロードできなかったか、リカバリーモードを利用できなかったためです。
そんなユーザーもご安心ください。メールがなくても重大なエラーを修正する方法をご紹介します。
一方、WordPressの技術的問題のメール通知を受け取った場合は、その意味を理解し、サイトを復活させるために使用する方法を紹介します。
下のリンクをクリックすると、必要なセクションに直接ジャンプできます:
WordPressデバッグメールでクリティカルエラーを修正する
まず、あなたのサイトのWordPress管理者メールアドレスの受信トレイにアクセスする必要があります。
管理者用メールとして使用したメールアドレスがわからなくなっていませんか?WordPressをインストールする際に入力したメールアドレスです。
あなたのサイトがBluehostを使用しているか、WordPressの自動インストーラを使用した場合、管理者メールアドレスは、おそらくWordPressのホスティングアカウントに使用したものと同じものです。
受信トレイに「お客様のサイトに技術的な問題が発生しています」という件名のメールが届きます。このメールには、WordPress サイトで重大なエラーが発生した原因について、より役立つ情報が記載されています。
例えば、以下のスクリーンショットは、テストサイトのWordPressテーマが原因で重大なエラーが発生したことを示しています。
メールには、リカバリーモードでWordPressサイトにログインし、問題を調査および修正するための固有のリンクも含まれています。
メールの下部には、エラーの原因となった特定のファイルやコードなど、エラーに関するさらに詳細な情報が表示されます。
以下の例では、テーマのfunctions.phpファイルの614行目にあるコードがエラーを引き起こしています。
WordPressプラグインの不具合によるエラーの例です。
ご覧のように、メッセージはプラグイン名とエラーの原因となっているコード行を強調表示します。
WordPressのリカバリーモードへのリンクをクリックすると、WordPressの管理エリアに移動します。
続行するにはログインを求められます。
ログイン中、クリティカルエラーについての通知、エラーの原因、エラーを修正するためのリンクが表示されます。
例えば、以下のスクリーンショットでは、WordPressはプラグインページへのリンクとともに、プラグインによって引き起こされた重大なエラーを通知している。
リンクをクリックすると、問題のプラグインが表示されます。また、エラーの原因となったコードの行も表示されます。
無効化」をクリックして、プラグインを無効化することができます。
その場合は、別のWordPressプラグインを探すか、プラグイン開発者からサポートを受けられるかどうかを確認すればよい。
同様に、問題がテーマにある場合は、テーマページへのリンクが表示されます。ページの下部には、どのテーマが問題を引き起こしているかが表示されます。
WordPressのテーマを変更することができます。あるいは、壊れたテーマを削除し、公式のソースから新しいテーマを再インストールして、問題が解決するかどうかを確認することもできます。
問題に対処したら、上部にある「リカバリーモードを終了」ボタンをクリックします。
ほとんどの場合、WordPressサイトは正常に動作するようになります。
それでもWordPressで重大なエラーが表示される場合は、次のセクションのトラブルシューティングをお試しください。
WordPressのクリティカルエラーを手動で修正する(メールなし)
WordPressの重大な問題の通知メールが届かなかった場合、この方法でWordPressの重大なエラーのトラブルシューティングと修正方法を学ぶことができます。
エラーの原因が最近行った操作にある場合は、その操作を取り消すことで問題を解決できます。
例えば、新しいプラグインをインストールし、有効化したために重大なエラーが発生した場合、そのプラグインを無効化する必要があります(以下の最初のステップでその方法を説明します)。
一方、エラーの原因がわからない場合は、以下の手順に従ってください。
1.WordPressのプラグインをすべて無効化する。
WordPressの重大なエラーの一般的な原因は、プラグインの競合やプラグインの非互換性です。これを解決するには、単に無効化することによって、障害のあるプラグインを無効にする必要があります.
しかし、クリティカルエラーのため、管理エリア(WordPressのバックエンド)にアクセスすることができず、どのプラグインを無効化すればよいかもわかりません。
これに対処するため、WordPressのプラグインをすべて無効化します。ご心配なく。WordPressの管理エリアにアクセスすれば、簡単に再アクティブ化できます。
FTPクライアントまたはウェブホスティングコントロールパネルのファイルマネージャーアプリを使用してWordPressサイトに接続するだけです。
接続したら、wp-contentフォルダーに移動する必要があります。
wp-contentフォルダーの中に’plugins’というフォルダーがあります。それを右クリックし、「名前の変更」オプションを選択する必要があります。
次に、’plugins’フォルダー名を好きなものに変更してください。この例では、「plugins.無効化」と呼ぶことにする。
WordPressは有効化したプラグインをサイトに読み込むためにプラグインフォルダーを探します。プラグインフォルダーが見つからない場合、有効化することができず、自動的に無効化されます。
これでサイトにアクセスして、重大なエラーメッセージが消えたかどうかを確認できる。
重要です:クリティカルエラーの問題を解決した場合は、「plugins」フォルダーの名前を変更することを忘れないでください。WordPressはこのフォルダを認識し、WordPressダッシュボードからプラグインを1つずつ再アクティブ化することで、クリティカルエラーの原因となったプラグインを特定することができます。
詳しくは、WordPressプラグインをすべて無効化する方法のチュートリアルをご覧ください。
2.デフォルトテーマに切り替える
クリティカルエラーのトラブルシューティングの次のステップは、WordPressテーマを初期設定に切り替えることです。現在のWordPressテーマのコードが問題を引き起こしている場合は、この方法でクリティカルエラーの問題を解決できます。
WordPress.orgのテーマディレクトリに行き、Twenty Twenty-TwoやTwenty Twenty-Threeのような初期設定のテーマをダウンロードするだけです。
次に、テーマファイルをコンピューターに解凍する必要があります。
これでコンピューターにテーマ名のフォルダーが作成されます。
次に、FTPクライアントまたはホスティングコントロールパネルのファイルマネージャーアプリを使用してWordPressサイトに接続する必要があります。
接続が完了したら、/wp-content/themes フォルダーに移動すると、サイトにインストールされているすべてのテーマのリストが表示されます。
これらのフォルダーをすべてバックアップとしてコンピューターにダウンロードしてください。
その後、サイトからテーマフォルダーをすべて削除する必要があります。
WordPressサイトにはテーマがインストールされていません。
これを修正するには、以前にダウンロードした初期テーマフォルダーをアップロードします。
このプロセスが終了したら、サイトにアクセスしてみてください。
WordPressテーマが原因で重大なエラーが発生した場合は、エラーメッセージが消え、サイトにアクセスできるようになっているはずです。
3.WordPressの再インストール
WordPressのコアファイルの破損やマルウェアも、WordPressの重大なエラーを引き起こす可能性があります。これを解決する最も簡単な方法は、WordPressを再インストールすることです。
WordPress.orgにアクセスし、新しいWordPressをコンピューターにダウンロードするだけです。
ファイルをダウンロードしたら、コンピューターに解凍する必要があります。すると、再インストールに必要なすべてのファイルが入った「WordPress」というフォルダーが作成されます。
次に、FTPクライアントまたはホスティングアカウントのダッシュボードまたはcPanel(コントロールパネル)のファイルマネージャーアプリを使用してWordPressサイトに接続します。
接続したら、サイトのルート・フォルダーに移動します。これは、wp-admin、wp-content、wp-includes、およびwp-adminフォルダを含むフォルダです。
コンピューター上の「WordPress」フォルダー内のファイルを選択し、サイトにアップロードします。
FTPクライアントが、これらのファイルを上書きするかスキップするかを尋ねてきます。上書き」を選択し、「常にこのアクションを使用する」にチェックを入れる必要があります。
次に、「OK」ボタンをクリックして続行します。FTPクライアントが、WordPressのコアファイルをコンピューターからコピーしたものに置き換えます。
完了したら、サイトにアクセスしてみて、エラーが解決するかどうか確認してください。
WordPressコアファイルの破損やマルウェアが原因で重大なエラーが発生した場合は、エラーメッセージは表示されなくなります。
4.WordPressのデバッグをオンにする
WordPressには、エラーをキャッチし、ログファイルに保存し、問題をトラブルシューティングできるデバッグシステムがビルトインされています。
これを有効にするには、wp-config.phpファイルを編集してデバッグ・モードを有効化する必要があります。以下の行を探してください:
define( 'WP_DEBUG', false );
では、この行を次のコードに置き換えてください:
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_DISPLAY', true );
define( 'WP_DEBUG_LOG', true );
define( 'SCRIPT_DEBUG', true );
WordPressサイトにアクセスすると、デバッグ情報と重大なエラーメッセージが表示されます。
デバッグモードは、PHPのエラーだけでなく警告や通知も表示します。これは、問題の原因を突き止め、それを修正するのに役立ちます。
また、エラーログをdebug.logファイルに保存し、そのファイルを/wp-content/フォルダに保存します。
5.PHPのメモリ制限を増やす
ホスティングウェブサーバーは他のコンピューターと同じです。複数のアプリケーションを同時に効率的に実行するにはメモリが必要です。
サーバーにPHPを実行するのに十分なリソースがない場合、クラッシュしたり応答しなくなったりすることがあります。これはWordPressのクリティカルエラーを引き起こす可能性があります。
これを解決するには、ホスティングサービスサーバーにPHPにより多くのメモリを使用するように指示することで、PHPのメモリ制限を増やすことができます。
そのためには、wp-config.phpファイルに以下の行を入力します。
define( 'WP_MEMORY_LIMIT', '512M' );
変更を保存してサーバーにアップロードすることを忘れないでください。
詳しくは、WordPressのPHPメモリ制限を増やす方法のチュートリアルをご覧ください。
さて、これで重大なエラーが解決したかどうか、サイトにアクセスしてみてください。
6.PHPバージョンのアップグレード状況
WordPressにはPHPバージョン7.4以上が必須です。WordPressホスティングサービスサーバーが古いバージョンのPHPを使用している場合、うまく動作せず、重大なエラーを引き起こす可能性があります。
WordPressのリカバリーモードにアクセスできる場合は、ツール ” サイトの健全性ページにアクセスし、情報タブに切り替えることで、サイトが使用しているPHPバージョンを確認できます。
ここからサーバーセクションまでスクロールダウンし、クリックして展開する。
そこに、ホスティングサービスサーバーにインストールされているPHPのバージョンが表示されます。
7.4より低い場合は、PHPのバージョンを更新する必要があります。
ほとんどの優れたWordPressホスティングサービス会社では、ホスティングアカウントのコントロールパネルから簡単に行うことができます。詳細については、人気のあるWordPressホスティングサービスプロバイダーでPHPバージョンを更新する方法の投稿を参照してください。
この投稿が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.
Syed Balkhi
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!
Elliot Walker
Thanks for the guide. Do you know if there is a tool to monitor and notify me if my site has a WordPress error like this? Can an UpTime monitor tell if a page is not navigable and is displaying such messages?
WPBeginner Support
We would recommend taking a look at our article below for these questions. Most uptime monitor tools should tell you if there is an error on a page where it can’t be seen by your users.
https://www.wpbeginner.com/plugins/how-to-monitor-server-uptime-in-wordpress/
管理者
rahul
I got the critical error message and I can’t view my website. I signed into my cPanel and went to the plug-ins folder in the file manager. When I right click on the plug-ins folder there is no “rename” option to select. I don’t know what to do to get my website back.
WPBeginner Support
Your hosting provider may have customized their file manager. You would want to try right-clicking the file or reaching out to your hosting provider and they should be able to assist!
管理者
AhmanPg
Updating to the newest PHP versions often resolves the issue, since some new plugin updates wont work with older PHP vers
WPBeginner Support
Not always, sometimes a plugin or theme may not be set up to work with the newest version of PHP but that can help in some situations
管理者
Bert Beckers
I’m having this issue on a multisite install. After deleting some outdated (and unsupported) plugins, suddently one of my sites showed this error. Is there any way to get into the admin panel without the automated email?
WPBeginner Support
You would want to take a look at the second method in this guide for troubleshooting without the email.
管理者
Keith
This post is still really helpful. LIFE SAVER! Removing and re-introducing the plugins worked! Thanks so much for providing this information.
WPBeginner Support
Glad our guide helped
管理者
saad
thank you so much
WPBeginner Support
You’re welcome!
管理者
Marie
I get this error on one page only. When a WPforms form is submitted. I’ve done everything on this page and still get the error on that one page. The form does actually work despite users getting this error
WPBeginner Support
We would recommend reaching out to WPForms’ support directly if that is the plugin causing the error and they can help troubleshoot the error.
管理者
Anu
Thank you so much. It was very helpful.
WPBeginner Support
Glad our guide was helpful!
管理者
Mel
I am working on a test site for the company I work for. I got the critical error message but no email. I can’t figure out how to get back on my site to fix it as all I see is the message itself. Thank you!
WPBeginner Support
The manual method from this article should help you with how to handle it
管理者
Herbert Thiel
Thank you so much for being here. It seems whenever I have an issue and I Google it I wind up here to get the right (helpful) answer. So now I come here first.
WPBeginner Support
Glad our articles have helped and we hope you continue to find our guides helpful
管理者
Paul
This is an excellent tutorial and enabled me to get my ancient website up and running again – caused by out of date plugins. Thank you so much.
WPBeginner Support
Glad our guide could help you get up and running again!
管理者
Carlos Rodriguez
Thanks for this article, it was very helpful, WP should send this link rather than the one they send on a critical error link they send.
Cheers!
WPBeginner Support
You’re welcome! Glad our guide could help and maybe one day
管理者
Lynda
I am so very happy that I found this resource page. It was really helpful and saved me from paying someone to fix the issue. I followed the instructions under “Manually (Without Email)”. Use my host site to make the changes to the plugins folder as per the instructions and IT WORKS!!!
THANK YOU SO MUCH!
WPBeginner Support
Thank you for your thanks and glad to hear our guide could help!
管理者
Abby
Thanks for this, really helpful. I deleted the plugin using the manual method, renaming the plugin folder, saving me a ton of time!
WPBeginner Support
You’re welcome! Glad to hear our recommendation helped!
管理者
Julio
Thank you for the help, I appreciate that!
WPBeginner Support
You’re welcome!
管理者
Rob Mccolley
In item #3 above, there’s no step-by-step for the File Manager method of reinstalling WordPress.
You write that either FTP or File Manager can be used, but offer steps for FTP only. Did I miss something?
Thanks.
WPBeginner Support
The file manager varies between hosting providers which is why we do not have a detailed guide on how to use it at the moment. If you check with your hosting provider they should be able to assist you
管理者
Sudeep
Hi… thanks for such a nice post.
I renamed my Plugins folder to Plugins.deactivate, and after that I could log into my dashboard. But as soon as I rename the Plugins.deactivate back to Plugins, I get out of my site, and the error message comes back.
What should be the next step? It seems that the problem is with the Plugins folder, but how do I use it if I cannot rename it back to its original?
~ Sudeep
WPBeginner Support
For that issue, it seems like one of your plugins is having a major error, you could manually create a plugins folder and move the individual plugins back into the plugins folder to find which of your plugins is the root of the error.
管理者
Sudeep
Okay. Thanks. Will do that
RAGHUL DHARMARAJAN
I got the e-mail with the WordPress recovery mode link. But it’s just opening my broken website only – not the WordPress recovery mode login page. The link is not expired.
WPBeginner Support
It sounds like the recovery email is not working properly in which case we would recommend using the second method from this guide.
管理者
Sumit Sharma
Thanks a ton for this post. Keep up the great work.
WPBeginner Support
Glad our guide was helpful!
管理者
Carly
Thank you so much for this amazing post! It was momentarily very stressful to have my website down but these clear, easy instructions helped to keep me calm and I was able to fix it quickly.
WPBeginner Support
Glad our guide could help you solve this error!
管理者
Craig
Thank you so much – your article was brilliantly clear & saved lots of stress!
WPBeginner Support
Glad our article was helpful!
管理者
Margaret agard
thank you so much! Got an email from google at 2 AM saying my site couldn’t be indexed. Got the critical error and followed your instructions.
When I renamed the plugin folder back still got the error so I I actually had to rename each plugin file and then test each one until I found the one that caused the problem
Again thank you. Was going to be on a show that day sending people to the website! Now it’s working and I can go back to sleep. Big smiles here!
WPBeginner Support
Happy to hear our guide could help and hope you slept well!
管理者
Jamesetta
I tried but it did not work. I got as far as the renamed plugin but could not find the plugins afterwards to reactivate. It got a bit confusing. I hope my site comes back up because everything went crazy even after I renamed to plugins again.
WPBeginner Support
To have your plugins available again you would want to revert the name of the plugins that you changed to their original names and they should appear again.
管理者
Stefanie
You can always be counted on when I need you! I was getting the critical error but never got the email so was clueless. I followed your steps (although I panicked for a moment after I renamed the folder) and sure enough-I found the plugin causing the problems.
Thank you so much for your help
WPBeginner Support
Glad our guide could help!
管理者
Dennis
Just wanted to say thanks for this clear article. It’s all you need to know in this situation. Resolved this issue with this, saving me a lot of googling, and life’s too short for googling :-).
WPBeginner Support
Glad our guide was able to help
管理者
momin
what should I do when I try to install a plugin or any theme and my WordPress website show a critical situation on the to bar.
I’ll fix it earlier now if I install every theme it appears again.. please let me know what can do?
WPBeginner Support
You may want to check your hosting provider’s error log to see if there is a specific error there but the most likely reason would be if your file permissions are incorrect. You could try the method from our article below for another option:
https://www.wpbeginner.com/wp-tutorials/how-to-fix-image-upload-issue-in-wordpress/
管理者
Christine
I got the critical error message and I can’t view my website. I signed into my cPanel and went to the plug-ins folder in the file manager. When I right click on the plug-ins folder there is no “rename” option to select. I don’t know what to do to get my website back.