Title: file_get_contents エラーを解消したい
Last modified: 2023年4月15日

---

# file_get_contents エラーを解消したい

 *  解決済 [shtkhs79](https://ja.wordpress.org/support/users/shtkhs79/)
 * (@shtkhs79)
 * [3年、 7ヶ月前](https://ja.wordpress.org/support/topic/file_get_contents-%e3%82%a8%e3%83%a9%e3%83%bc%e3%82%92%e8%a7%a3%e6%b6%88%e3%81%97%e3%81%9f%e3%81%84/)
 * ワードプレスのサーバーを移転してから、投稿ページ上部に下記エラーが表示されます。
 *     ```wp-block-code
       Warning: file_get_contents(http://移転前のURL/wp-content/themes/xxx/images/header_logo.png): failed to open stream: HTTP request failed! HTTP/1.0 404 Not Found in /home/xxx/wp-includes/class-wp-image-editor-imagick.php on line 154
       ```
   
 * class-wp-image-editor-imagick.phpの154行を@file_get_contentsとするとエラーは消
   え、使用する上で問題は無いのですが、根本の原因が分からず困っています。
   何か思い当たる
   点がありましたらご教授いただけますと幸いです。
 * 何卒よろしくお願い申し上げます。

4件の返信を表示中 - 1 - 4件目 (全4件中)

 *  [manbo](https://ja.wordpress.org/support/users/manbo/)
 * (@manbo)
 * [3年、 7ヶ月前](https://ja.wordpress.org/support/topic/file_get_contents-%e3%82%a8%e3%83%a9%e3%83%bc%e3%82%92%e8%a7%a3%e6%b6%88%e3%81%97%e3%81%9f%e3%81%84/#post-11683098)
 * 移転前のURLというのがデータベース等に残っているのでは？
 *  トピック投稿者 [shtkhs79](https://ja.wordpress.org/support/users/shtkhs79/)
 * (@shtkhs79)
 * [3年、 7ヶ月前](https://ja.wordpress.org/support/topic/file_get_contents-%e3%82%a8%e3%83%a9%e3%83%bc%e3%82%92%e8%a7%a3%e6%b6%88%e3%81%97%e3%81%9f%e3%81%84/#post-11683102)
 * 有難うございます。
   DBを調べてみたのですが該当箇所が不明でした。引き続き調べて
   みます。
 *  [shokun0803](https://ja.wordpress.org/support/users/shokun0803/)
 * (@shokun0803)
 * [3年、 6ヶ月前](https://ja.wordpress.org/support/topic/file_get_contents-%e3%82%a8%e3%83%a9%e3%83%bc%e3%82%92%e8%a7%a3%e6%b6%88%e3%81%97%e3%81%9f%e3%81%84/#post-11683122)
 * shtkhs79さん、こんにちは。
 * `wp-includes/class-wp-image-editor-imagick.php`の内容を編集することはお勧めでき
   ません。それは WordPress のコアファイルですし、`@file_get_contents`とすること
   はエラーを抑制しているにすぎません。
 * 元のエラーが出ている箇所が`wp-content/themes/xxx/images/header_logo.png`ですので、
   テーマファイル内のロゴ画像が古いドメインの画像を探してのエラーではないかと思われ
   ます。テーマファイル内の`header_logo.png`を現在の画像で置き換えてみる等実施さ
   れてみてはいかがでしょうか。
 * ご参考になれば。
 *  トピック投稿者 [shtkhs79](https://ja.wordpress.org/support/users/shtkhs79/)
 * (@shtkhs79)
 * [3年、 6ヶ月前](https://ja.wordpress.org/support/topic/file_get_contents-%e3%82%a8%e3%83%a9%e3%83%bc%e3%82%92%e8%a7%a3%e6%b6%88%e3%81%97%e3%81%9f%e3%81%84/#post-11683127)
 * [shokun0803](https://ja.wordpress.org/support/users/shokun0803/)さんこんにちは。
 * プラグイン**Markup (JSON-LD) structured in schema.org**の中身に旧URLが残ってい
   たのがエラーとなっていました。制作後の管理を他に任せていたため盲点でした。お恥ずかしい
   限りです。
 * 大変参考になり助かりました。有難うございます。

4件の返信を表示中 - 1 - 4件目 (全4件中)

 トピック「file_get_contents エラーを解消したい」には新たに返信することはできません。

 * フォーラム: [使い方全般](https://ja.wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 4件の返信
 * 3人の参加者
 * 最後の返信者: [shtkhs79](https://ja.wordpress.org/support/users/shtkhs79/)
 * 最後の活動: [3年、 6ヶ月前](https://ja.wordpress.org/support/topic/file_get_contents-%e3%82%a8%e3%83%a9%e3%83%bc%e3%82%92%e8%a7%a3%e6%b6%88%e3%81%97%e3%81%9f%e3%81%84/#post-11683127)
 * 状態: 解決済

## トピック

### 人気のトピック

### 返信がないトピック

### サポート関連ではないトピック

### 解決済みのトピック

### 未解決のトピック

### すべてのトピック
