Hi @guardiano78,
If you’re using the “Use existing file” option, you can enable “Delete source XML file after importing” on Step 4 of the import (under “Configure Advanced Settings”).
Otherwise, you will need to write custom code that uses the pmxi_after_xml_import hook to do it. Example: https://www.wpallimport.com/documentation/developers/code-snippets/#delete-import-file-after-import.
Hello, thank you.
I’m using “Download from URL”.
I put my file in a folder on the same host but in another location.
For example: /public_html/my_folder/products.zip (zip file contains products.xml);
I need that when importation is completed, “products.zip” is deleted.
Is it possible?
thanks.
Hi @guardiano78,
I need that when importation is completed, “products.zip” is deleted. Is it possible?
That should be possible, but you’d have to write custom code that uses our API to do it (see the link above).
Hello,
I followed your advice and used the delete_import_file() function.
I add this code:
$home_path = get_home_path();
$import_name = $history_file->name;
$zip_delete = $home_path . 'my-folder/' . $import_name;
@unlink ($zip_delete);
It works!
Do you think it is the right way?
thank you.
Hi @guardiano78,
I haven’t tested it, but I don’t see any immediate issues. Looks like it should work.