Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 20480 bytes) in /var/www/web24689573/html/wp-includes/meta.php on line 841
Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 20480 bytes) in /var/www/web24689573/html/wp-includes/plugin.php on line 449
The reason why I get this error is, because I handle a lot of datas to set prices and etc. in WordPress. At the moment for over 5000 products and each product can have multiple prices (price comparsion). Plus, every product need to be assigned to a category and stuff like this. So, I have many request via PHP with WordPress.
I know that this error doesn't comes from the script itselfs. My question now is, what would you advise me to do?
I already disabled the cache and things like that as you can see here:
add_action( 'pre_get_posts', 'jb_pre_get_posts' );
function jb_pre_get_posts( WP_Query $wp_query ) {
if ( in_array( $wp_query->get( 'post_type' ), array( 'my_post_type_1', 'my_post_type_2' ) ) ) {
$wp_query->set( 'update_post_meta_cache', false );
}
}
Here you can read why this error comes: http://www.junaidbhura.com/wordpress-admin-fix-fatal-error-allowed-memory-size-error/
But I think now I am nearly at the limit of the RAM (4GB). Would be very thankful about your advises and tips.
Greetings