One of the common WordPress error is the ‘connection timed out’ which is caused by an overburdened shared server. The main causes are heavy plugins, theme function issues, and exhausted PHP memory limit.
How to Fix It
This error can be fixed very easily in different ways:
First possibility is to increase the memory limit of PHP in wp-config.php. If you are using shared hosting you may have to ask your hosting provider to increase your memory limit. This allows you to run heavy plugins successfully.
The second way is to increase the maximum execution time in your php.ini file. However this is not a WordPress core file, so if you are not sure how to edit it, contact your hosting provider to increase your maximum execution time.
Another way is to first deactivate all the plugins and reactivate them one-by-one to see which plugin is causing the problem and then carefully remove the one that is causing the trouble.
The last method that you can adapt to resolve the problem is to switch to a default WordPress theme to identify if there is any problem caused by the theme.