WordPress Defined Memory Limit

Try one (or more) of the below methods to increase the memory allicated by PHP. First try increasing the limit to 64MB, and if that fails use 96M. You can define the WP_MEMORY_LIMIT constant in wp-config.php: Increase PHP Memory to 64MB define(‘WP_MEMORY_LIMIT’, ’64M’); Increase PHP Memory to 96MB define(‘WP_MEMORY_LIMIT’, ’96M’); You can also change the … Read more

Make WP_Query more efficient?

you can try some of these extra parameters: ‘update_post_term_cache’ => false, ‘update_post_meta_cache’ => false, ‘cache_results’=>false, ‘no_found_rows’ => true, ‘posts_per_page’=>1, ‘post_status’=’publish’, ps: you can measure the speed of your query when you are testing it with microtime() http://php.net/manual/en/function.microtime.php Edit: Here is a another way: function count_votes($user_id=1, $question_id=1, $post_type=”vote”, $meta_key=’comp_question’){ global $wpdb; $sql = “SELECT count(*) FROM … Read more

Updating beyond WordPress 4.2.1 yields “allowed memory size exhausted”

Edit line 149 in file.php as described in this thread: https://wordpress.org/support/topic/unable-to-update-plugins-after-upgrade-to-42 fixed it for me (on a linux host). edit: just read you are on windows: someone also posted a fix that applies to windows hosts there (apparently more complicated because backslashes are used in filepaths). so your line 149 in file.php should read: if … Read more

Are there individual memory allocations for different user roles in WordPress?

Because of this line in wp-admin/admin.php: if ( current_user_can( ‘manage_options’ ) ) { wp_raise_memory_limit( ‘admin’ ); } In other words, WordPress raises the memory limit to WP_MAX_MEMORY_LIMIT within the admin, but only for users with the manage_options capability i.e. administrators. Your best bet is to raise the default memory limit in your wp-config.php: define( ‘WP_MEMORY_LIMIT’, … Read more

Memory errors with media upload, WordPress can’t use more than 96M (while there’s 512 available!)

You’re looking at the problem the wrong way. The error you’re seeing isn’t an error coming from WordPress, it’s a PHP error. Somehow, somewhere, something is limiting the memory limit to 96M, and it ain’t WordPress that’s doing it. Here’s the thing: WordPress can’t actually limit the memory on most servers. I know that it … Read more