Skip to content

Instantly share code, notes, and snippets.

@EnigmaCurry
Created December 5, 2010 00:55
Show Gist options
  • Save EnigmaCurry/728652 to your computer and use it in GitHub Desktop.
Save EnigmaCurry/728652 to your computer and use it in GitHub Desktop.
Remove empty books from calibre (books that have no formats available)
calibredb list -f title,author_sort,formats | grep ".*\[\]\W*$" | cut -d " " -f 1 | xargs -iXX calibredb remove XX
Copy link

ghost commented May 5, 2015

Delete empty books -> Search: formats:false -> Select all -> Remove books

For those who found this using Google

@MKentV
Copy link

MKentV commented Jan 16, 2021

I know this is an old post but it solved my issue today - I love a simple solution!

@walterbe
Copy link

walterbe commented Jan 28, 2022

2022 calling! Thanks to the past. Still works with current Calibre. - Strange that Calibre would import 'books' that are available in 0 formats. It where just name of author & title and the cover art.

Clarification;I did not use the script. I mean; go to the search box in Calibre. Click on the configuration icon.And search there to formats:false. Then you have the selection of all empty books. Verify some to see the are indeed empty. ctrl+A to select all. And then 'remove books'. - This works fast even with a large database. No need to use manual commands.

@demaniak
Copy link

@walterbe
It seems it's possible to create an "empty" book in calibre, and then add files to it later. So that would probably why this happens.

@muttmutt
Copy link

Greetings from the future! 2025 and this still works! I get a couple of plugin initiation errors, but the script removes titles without formats.

Failed to initialize plugin: '/Users/prscarr/Library/Preferences/calibre/plugins/Goodreads.zip'
Failed to initialize plugin: '/Users/prscarr/Library/Preferences/calibre/plugins/Ignoble Epub DeDRM.zip'
Failed to initialize plugin: '/Users/prscarr/Library/Preferences/calibre/plugins/Inept Epub DeDRM.zip'
Failed to initialize plugin: '/Users/prscarr/Library/Preferences/calibre/plugins/Inept PDF DeDRM.zip'
Failed to initialize plugin: '/Users/prscarr/Library/Preferences/calibre/plugins/Kindle and Mobipocket DeDRM.zip'
Failed to initialize plugin: '/Users/prscarr/Library/Preferences/calibre/plugins/eReader PDB 2 PML.zip'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment