Skip to content

Database Management

The database should keep itself under control without any manual intervention, but steps can be taken to minimize the database size if desired. The simplest option is to run the ‘elfeed-db-compact’ command, which will pack the loose-file content database into a single compressed file. We recommend to execute ‘elfeed-db-compact’ from time to time manually.

Going further, a function could be added to ‘elfeed-new-entry-hook’ to strip unwanted/unneeded content from select entries before being stored in the database. For example, for YouTube videos only the entry link is of interest and the regularly-changing entry content could be tossed to save time and storage.

emacs-lisp
(defun strip-old-content ()
  (let ((limit (elfeed-float-time "60 days ago")))
    (elfeed-db-visit (entry feed)
      (cond
       ((< (elfeed-entry-date entry) limit)
        (elfeed-db-return))
       ((equal "https://example.com/feed/" (elfeed-feed-url feed))
        (setf (elfeed-entry-content entry) nil))))))