Import WordPress – File Is Empty

WordPress Tips

Normally if you are moving WordPress from one server to another you’ll run an Export operation on the original site. Then you go to your new site and install a blank WordPress site. Once WordPress is running in that blank new state, you go into Tools – Import – Import WordPress. You might need to install the plug-in, but then you just select the import file and let it run.

However, what do you do when your file is over 8mb in size?

You probably can see on the import page that it says this:

Choose a file from your computer: (Maximum size: 8 MB)

That right there is giving you the warning. If your import file is over 8mb – which many sites easily are – you’re going to hit a problem.

That 8mb is NOT a WordPress setting. It is a PHP setting, because PHP is controlling that import.

What Version of PHP Are You Running?

The first thing to do is determine which version of PHP you are running. Oddly, WordPress doesn’t have a built-in way of telling you this. You have to install a separate PHP plugin called Display PHP Version. Once you install and activate that, you’ll get a line on your main dashboard telling you your PHP version. That’s useful to have.

OK, so you know the PHP version now. Go into your actual server and go into File Manager. In Windows, you want to look in your Program Files directory. You should have a folder called PHP and beneath that a folder with the version number you’re active with. In this case the sub-folder is called v7.3.

Look for the PHP.INI file and open it in a text editor.

Search for the word “upload” and find this section:

; Maximum allowed size for uploaded files.
; http://php.net/upload-max-filesize
upload_max_filesize = 128M

Make sure the upload_max_filesize is larger than your file.

Also set:

post_max_size = 128M

to the same value.

If you want to be doubly sure, you can also edit your wp-config.php file and right before the “that’s all stop editing!” line add in:

@ini_set(‘upload_max_size’ , ‘256M’ );

Save the files.

This is the error you can get:

Sorry, there has been an error.

File is empty. Please upload something more substantial. This error could also be caused by uploads being disabled in your php.ini or by post_max_size being defined as smaller than upload_max_filesize in php.ini.

Once you make the changes and increase the values, you should see right on the import page itself that your maximum size is now larger. In this case, it should be showing 128mb.

Good luck!

Be the first to comment

Leave a Reply

Your email address will not be published.


*


This site uses Akismet to reduce spam. Learn how your comment data is processed.