Delete all unassigned articles

Hi folks,

Is there some way to delete all unassigned articles (like maybe from the database somewhere)? I have a lot of them (from deleted issues) and I really don’t want to spend time archiving and deleting them individually.

Thanks.

Hi @mgv42,

You can use tools/deleteSubmissions.php to delete submissions by ID.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi Alex can specify the process please ?, is from the console ? I as you select files from the console or what the next step ?. thanks

Hi @mimolore,

This is something you’ll need to do from the command line. If you have access to the command line, you can run…

php tools/deleteSubmissions.php 12345

…where 12345 is a submission ID.

Regards,
Alec Smecher
Public Knowledge Project Team

2 Likes

Hi, thank you for response, but the step just its only one by one submission?. Is posible delete all of them in one step?. Thanks

Hi @mimolore,

You can delete as many submissions as you want at once by specifying multiple submission IDs.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi Alec, so many thanks. it´s posible write a command to delete consecutive ID´s, like a [998-1021]?.

This can be done in your shell:

Is there a way to specify that only the unpublished submissions get deleted? We imported a large number of articles from another CMS into OJS and the database is cluttered with empty submissions that I’d like to clear out.

Hi @rcostain,

Not currently; you’d need to specify the IDs of the submissions you want to delete.

Regards,
Alec Smecher
Public Knowledge Project Team

Just pasting the solution for deleting submissions between specific ID’s if I ever come back looking for it…

for i in {INSERTIDHERE..INSERIDHERE}; do php tools/deleteSubmissions.php $i; done

1 Like

Hi! Before we run delete submissions from the command line, I just want to double check - are all submission IDs unique in a multi-journal OJS installation? That is, does submission ID 12345, for example, refer to only one submission among all journals? Seems like it should be that way, but don’t want to assume and inadvertently delete something we shouldn’t. thanks!

Hi,

If you have a single installation of OJS with one database the ID is unique. You can check this from your database by looking at the table called submissions. That table, like all the other tables, are shared between the different journals in your installation. The submission ID is basically auto incremented every time a new submission is added to the system.

Of course it is always a good idea to make a backup just in case.