I have been using Better Search Replace for many years and I had had no need to contact support for a very long time. I am struggling with the
“An error occurred processing your request. Try decreasing the “Max Page Size”, or contact support.”
Even if I turn it down to 3000 and add a define( ‘WP_MEMORY_LIMIT’, ‘512M’ ); to the wp-config file and do a few hard refreshes it is still giving me the same error. When I search through the database it gets about half way before the error shows up.
define(‘WP_DEBUG’, true); // Turn on WP Debugging define(‘WP_DEBUG_LOG’, true); // Log errors to wp_debug.log define(‘WP_DEBUG_DISPLAY’, false); // Turns off error reporting on the front end
To the wp-config. Run the search and replace operation again. Get the error even on the lowest value of 1000. Then check the wp-content folder and do not see the debug log. I will have to contact the web host and ask about this.
I’m running into this same issue and was able to download the debug file, this is what I got:
20:29:30 UTC] PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 335872 bytes) in /home/h9cmpsjnotqu/public_html/staging-mentalhealthismaternalhealth.nektormedia.com/wp-includes/class-wpdb.php on line 2320
Better Search Replace Support Team here. Thanks for reaching out with your query, we would be happy to assist!
That error means that you are reaching your server’s memory limit. Please try increasing your WP_MEMORY_LIMIT to 256M or greater if you keep getting the error.
I’m having the same problem. I added the magic 3 lines to wpconfig and WP_DEBUG now shows as ENABLED. Memory is already at 512M.
Anything else I can try?
Thinking it has to do with the length of the string being searched for and/or the length of the string being replaced, I did some tests.
I have about 560 replacements (one per page/post) of a string that is 177 characters, replacing it with a string that is 71 characters.
Thinking those strings were too long, I cut it down to replacing a string of 40 characters with one of 12 characters. That should be well within the limits of the plugin.
It still tells me to decrease the Max Page Size. So, maybe it’s incapable of handling 560 replacements in one shot???
Is it possible to break it down so it does just 100 replacements at a time?
Do you know how many characters is the max string for searching and the max for replacing, and do you know the max number of replacements for one search/replace query??
It’s possible that you have one record in your database that is very large. Better Search Replace (BSR) uses your server’s memory to temporarily store this data as our plugin performs the search/replace, so it’s possible that your server’s memory couldn’t accommodate it.
One way to test this is to try running search/replace a few tables at a time, to see where it could be failing.
“Do you know how many characters is the max string for searching and the max for replacing, and do you know the max number of replacements for one search/replace query??” — The lengths of the search and replace parameters are limited by your server’s Post Max Size. I think most servers have a Post Max Size value large enough to accommodate simple text strings.
There really isn’t a maximum number of replacements per search/replace query. You may be limited by your server’s memory limit, or your server’s max_execution_time. BSR runs the search/replace by batches to try to ensure that it doesn’t go over your server’s limits.