この記事では、wp-config.php
ファイルにWP_MEMORY_LIMIT
を記載しても反映されない時の対処法をご紹介します。
チェックリスト
/* That's all, stop editing! Happy publishing. */
の前に記載している?
原因と対処法
/* That's all, stop editing! Happy publishing. */
の前に記載している?
/* That's all, stop editing! Happy publishing. */
の後ろに、define( 'WP_MEMORY_LIMIT', '256M' )
と記載しても反映されません。
つまりファイルの最後などに記載している場合、反映されないです。
/* That's all, stop editing! Happy publishing. */ /** Absolute path to the WordPress directory. */ if ( ! defined( 'ABSPATH' ) ) { define( 'ABSPATH', dirname( __FILE__ ) . '/' ); } define( 'WP_MEMORY_LIMIT', '256M' );
次のコードのように/* That's all, stop editing! Happy publishing. */
の前にWP_MEMORY_LIMITの定義を記載しましょう。
define( 'WP_MEMORY_LIMIT', '256M' ); /* That's all, stop editing! Happy publishing. */ /** Absolute path to the WordPress directory. */ if ( ! defined( 'ABSPATH' ) ) { define( 'ABSPATH', dirname( __FILE__ ) . '/' ); }