WP Rocket - WordPress Caching Plugin

A PHP error is displayed on my WordPress site, preventing the site from displaying (wp-includes/block-patterns.php on line 38).

At HanamiWEB Online School,

●Ask questions in real-time in the virtual study room!

●Ask as many questions as you want via chat!

●E-learning materials that you can learn as much as you want, 24 hours a day!

All included for just 2,500 yen/month!

WordPress7.0への更新の影響か、wp-includes/block-patterns.php On line 38というPHPエラーが出て、ホームページが表示されない不具合の相談が来ましたので、復旧方法をご紹介します。

WordPress block-patterns.phpエラーの原因

このエラーは register_block_pattern_category() という関数が見つからないというもので、この関数は WordPress 5.5以降で追加されたため、以下のどちらかが原因となります。

  • WordPressのバージョンが古い(5.5未満)
  • WordPressのコアファイルが壊れている・不完全

このサイトは月に一度、ちゃんとサイトの更新をしていたため、WordPressのバージョンが古いという事は考えられません。
WordPress7.0の自動更新が来ていた中でのエラーなので、「コアファイルが壊れて不完全な状態」になっている事が考えれます。

WordPressコアファイルを上書き

管理画面に入れないため、FTP経由で、WordPressコアファイルを上書きする方法になります。

WordPressコアファイルを公式サイトからダウンロード

WordPressコアファイル配布公式ページへアクセスするとこのようになっています。
ダウンロードしたい最新版のWordPressファイルをPCにダウンロードします。

ファイルマネージャーでサーバーにアクセスをして上書き

サーバーのファイルマネージャーからファイルの上書きも可能ですが、一括アップロードが出来ないため、FTPソフトを利用して、ファイルをサーバーにアップします。

アップするファイルは、今回エラーが起きてしまっている
/wp-includes/丸ごと上書きアップロードTo do.
wp-includesフォルダには、たくさんのフォルダとファイルが入っています。
全て一括でアップロード上書きします。

サーバーバックアップを利用する方法

サーバーのバックアップから、エラーの起きる前の日に戻す方法もあります。
タイミングが悪く、不完全な状態で更新されてしまったことが考えられる為、再度ネットワーク環境が良い状態で更新をしたらエラーが起きないこともあります。

Xserverの場合サーバーバックアップからの復元方法

サーバー > 自動バックアップの取得・復元より、復元したい日付を指定して、【実行ボタン】をクリックします。時間がかかりますので、終わりまで待ちます。

注意事項を確認した上で実行するボタンをクリックします。

WordPressサイト管理代行

HanamiWEBでは、WordPressサイト管理代行を行っております。
・月1回のサイト更新代行
・毎日マルウェアスキャン
・エラーが起きた時にすぐに対応
など、WordPressの専門家がサイトの管理を代行しております。
詳しくは、WordPressホームページ修正・更新代行保守・運用代行サービス詳細をご覧ください。

HanamiWEB

The person who wrote this article

Matsuura Misa

HanamiWEB Co., Ltd. / Web Production, SEO, and AI Search Engine Optimization Support

Based in Nerima Ward, Tokyo, we provide support for small and medium-sized businesses, including website creation, SEO measures, and site design that anticipates the era of AI search.
I specialize in practical improvement suggestions using WordPress and content design that focuses on customer acquisition funnels.
We also provide website maintenance and operation services.

We are available on weekends and holidays!

Please contact us if you have any problems with your website!

- Unable to log in to WordPress

Malware infection?

- The homepage suddenly stopped displaying!

- A PHP error is occurring.

We also offer support on weekends and holidays for those who need assistance.

If you are in a hurry, please call us now at 03-6694-7024.

Latest Articles

A PHP error is displayed on my WordPress site, preventing the site from displaying (wp-includes/block-patterns.php on line 38).
Nerima Ward: Ranked 2nd in website creation | Explanation of how to create a website that gets cited by AI
What is website update outsourcing? A clear explanation of costs, market rates, and how to request their services.
RankMath Webmaster Tools Setup Guide | Google Search Console & Bing
en_USEnglish