There are two ways you can fix this error. The first method is to fix it manually by editing your .htaccess file and the second method allows you to do the same thing with a plugin.
Method 1: Editing .htaccess File Manually
Simply connect to your website using an FTP client.
Your .htaccess file is located in the same folder as your /wp-content/ and /wp-admin/ folders.
Next, add this line to your .htaccess file: php_value max_execution_time 300
This code simply sets the value for maximum execution time to 300 seconds (5 minutes). If you still get the error, then try increasing the value to 600.
Method 2: Using a Plugin
If you don’t wish to edit .htaccess file manually, then you can install and activate the WP Maximum Execution Time Exceeded plugin.
That’s all. The plugin works out of the box and increases the maximum execution time to 300 seconds.