Skip Navigation

[Resolved] error 500, i have set Number of items per page to 999

This thread is resolved. Here is a description of the problem and solution.

Problem: I increased the number of items per page shown in wp-admin for a custom post type. I set it to 999, and now I'm seeing an error 500. I can't figure out how to fix it.

Solution: I found this message:

Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 20480 bytes) in /***/wp-includes/wp-db.php on line 1889

If it's possible to increase the amount of memory on your server, that would be the first thing to try. Something like 512MB instead of 256MB might work, but it's hard for me to know. If your host is able to bump up the memory to 512, you can try adding these lines in wp-config.php:

define('WP_MEMORY_LIMIT', '512M');
define( 'WP_MAX_MEMORY_LIMIT', '512M' );

If you're not able to get the memory increased, or you need a quick fix, I can show you how to modify this pagination value directly in the database.

ALWAYS MAKE A DATABASE BACKUP BEFORE MODIFYING DATABASE VALUES MANUALLY!

After you backup the db, in the usermeta table, look for a row where the User ID equals your User ID and the meta_key looks like "edit_voter_per_page". Yours may be slightly different based on your post type slug. You should find a row with the meta_value 999. Modify that value to be something smaller like 50. Then you should be able to regain access to the Voters dashboard.

This support ticket is created 6 years, 6 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

Tagged: 

This topic contains 3 replies, has 2 voices.

Last updated by Christian Cox 6 years, 6 months ago.

Assisted by: Christian Cox.

Author
Posts
#955554
999 500 error.jpg

I am trying to: error 500, i have set in the admin screen option the number of items per page to 999, now i'm getting error 500. please advice. i wanted to delete all the items in the VOTERS post type.

Link to a page where the issue can be seen:

I expected to see:

Instead, I got:

#955589

Hi, I activated server logs for a moment to get more information about this error, and I found this message:

Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 20480 bytes) in /***/wp-includes/wp-db.php on line 1889

If it's possible to increase the amount of memory on your server, that would be the first thing to try. Something like 512MB instead of 256MB might work, but it's hard for me to know. If your host is able to bump up the memory to 512, you can try adding these lines in wp-config.php:

define('WP_MEMORY_LIMIT', '512M');
define( 'WP_MAX_MEMORY_LIMIT', '512M' );

If you're not able to get the memory increased, or you need a quick fix, I can show you how to modify this pagination value directly in the database.

ALWAYS MAKE A DATABASE BACKUP BEFORE MODIFYING DATABASE VALUES MANUALLY!

After you backup the db, in the usermeta table, look for a row where the User ID equals your User ID and the meta_key looks like "edit_voter_per_page". Yours may be slightly different based on your post type slug. You should find a row with the meta_value 999. Modify that value to be something smaller like 50. Then you should be able to regain access to the Voters dashboard.

#955611
Screenshot_10.jpg

THANK YOU Christian
i have changed the db to 20.
tryed the 512mb option - not working.

now if i want to delete ALL the items in VOTERS post type, what is the esay way?

#955657

The most straightforward way to do it is to use wp-admin to select the posts and trash them, then empty the trash. If you're trying to manage a lot of posts, then it's probably not practical. You would have to write a custom SQL script or use phpMyAdmin to select all the post_type "voter" posts, then delete them. There may be some 3rd-party tool out there that helps delete posts from the DB and cleans out their metadata, but I can't vouch for any of those.

Another option is to export this site's data, but not include the Voters posts. Then import the data into another site.