How to fix Timeout error while importing XML backup file to WordPress

How to fix Timeout error while importing XML backup file to WordPress

If you are redesigning your WordPress blog / website, you might need to take the backup of your data in XML format from the old design and upload it on the new one. If your site had large amount of data, the XML file size will also be quite large. While you are uploading this file from WordPress Importer, you might face the timeout error.

What is Timeout error –

Every server or Website assigns a specific maximum execution time for any php script to run. If a script runs for more than the assigned time, the server stops that script automatically and gives a timeout error. It usually happen in one of the following case :

  1. If you are trying to upload a very large file – To upload a large file the upload script has to run for a long time which might exceed the maximum execution time, thus giving timeout error.
  2. If you are trying to import a backup file – If the import file size is too large, the import script has to run for quite a long time and sometimes it exceeds the assigned maximum execution time.
  3. If you are trying to access data from external server – If in case you are using any API and trying to access data from an external server. The other server might take sometime to respond to your data query. If this response time is larger than the maximum execution time, you will see a timeout error.

There can be multiple other reasons for this timeout error to occur. Here we are discussing the 2nd reason of timeout error. If the data import file size is quite large than we might get a timeout error.

How to Resolve this Timeout Error – 

To resolve this error you will need to increase the maximum execution time assigned on your server. If you are using a VPS ( Virtual Private Server) or Dedicated Server or any other type of hosting which provides the root access, you will be having access to your php.ini file. Find this file and follow the given steps :

  1. Go to your root directory and look for php.ini file.
  2. In this file look for the variable – max_execution_time
  3. This variable might have a certain value like 500 or 600. This value is in mili seconds.
  4. Change this value to the desired range.
  5. Do not put a very large value as it may give bots and spammers scripts more time to run, which will affect your website adversely
  6. In some server you might find a field in the settings section to change this value of maximum execution time.

If you like above article, please subscribe. We will keep you updated with our new Articles.

Leave your Feedback / Questions in Comments.

Leave a Reply

nineteen + four =

Close Menu