WP All Import Temp File Creation Bug
In a recent update of WP All Import Pro 4.9.XX if you have used a WordPress installer like Installatron in cPanel. This process adds the following definitions in the wp-config.php file.
define('WP_TEMP_DIR',dirname(__FILE__).'/wp-content/uploads');
When this is added and the import is run, the WP All Import process will create thousands... hundreds of thousands xim****.tmp files.
Disable the custom temp folder
First step is to edit your wp-config.php file and comment out the WP_TEMP_DIR line. Add two // before the define
// define('WP_TEMP_DIR',dirname(__FILE__).'/wp-content/uploads');
Next you will need to access the terminal of the site. Some cPanel installations provide terminal access. Login to your cPanel hosting, search for terminal.
If your hosting does not provide this, then it might be best to reach out to your hosting support to delete the files. As there are so many tmp files even loading the folder through FTP or the File Manager can fail.
Delete the xim files using terminal
PLEASE NOTE, this can cause major issues if performed incorrectly, take your time with the following process. Ensure you have a backup of your website.
Once you access the terminal you will see a plain login line. Our goal is to navigate to the correct folder before we delete files. We want to navigate to: public_html/wp-content/uploads
First perform a ls command (LS lowercase) to list the current directory you are in.
Use the cd command to change the directory you are in. When in terminal you can press the tab key to fill in the name.
Once you have navigated to the uploads folder perform a ls command to make sure you are in the correct folder. You should see lots of xim files.
Remove the XIM tmp files with the find terminal command
Once you have confirmed you are in the correct folder you will use the find command to remove the files that match your search string. In this case we want to remove any files that match xim_id_2-{random_string}.tmp
Note: You can't use the rm command (remove) as there are too many files.
Confirm you are in the correct location with the ls command.
Then run the following find command.
find . -type f -name "xim_id_2-*.tmp" -delete
Once complete, run the ls command to list the directory contents and is should just contain the usual WordPress uploads directory folders.
Hopefully this has corrected your issue with WP All Import Pro import performance in relation to the tmp files that are created during the imports.