Changing WP_MEMORY_LIMIT doesn’t affect actual memory limit

So you’ve tried setting the WP_MEMORY_LIMIT variable in the wp-config.php file, but have you tried .user.ini or .php.ini?

Create one of those files (yes, with the period in front) and then use:

memory_limit=30M

Or whatever value you’re looking for. By default, WordPress is set to 40mb for a single installation, and 64mb for a multisite installation.

But as Tom mentioned in the comments, the solution to your problem might not be this. This may lead to server timeouts instead.