Collection export includes subcollection items even when subcollections are hidden and recursiveColl
I think there is a Zotero collection export inconsistency when exporting a parent collection that has child subcollections.
Environment
- Zotero:
9.0(April 10, 2026) - OS: Windows
Expected behavior
When exporting a collection, Zotero should export only the items directly contained in that collection if subcollections are not being shown/exported.
Actual behavior
Exporting a collection includes items that are only in child subcollections.
Relevant collection
- Selected collection name:
MSR - ML - Selected collection key:
UDDNLLIG
It has 3 child collections:
Dataset(YQNWTYXV)Supplementary(DJPD3VJM)Expanded database(5AWL4F2D)
Configuration
extensions.zotero.recursiveCollections = false- “Show Items from Subcollections” is off
Reproduction
- Select collection
MSR - ML - Confirm subcollections are not shown in the center pane
- Export the collection directly from Zotero (for example to BibTeX/BibLaTeX)
- Compare with exporting the currently visible selected items from the same pane
Observed counts
- Visible regular items in collection pane:
78 collection.getChildItems().filter(item => item.isRegularItem()).length:78- Explicit recursive search for the same collection:
115 - Exporting selected visible items:
78 - Exporting the collection node:
115
So collection export matches the recursive item set, not the direct visible item set.
Important clarification
This does not seem to be specific to any third-party exporter. I reproduced this behavior using a direct Zotero export, so this appears to be on the Zotero side rather than an add-on-specific issue.
Also, some items in my library are intentionally members of both the parent collection and one or more child collections. That overlap is expected and is not the issue. The issue is that items that are only in child collections, and not directly in the parent collection, are also being exported when exporting the parent collection.
JS evidence
const zp = Zotero.getActiveZoteroPane();
const c = zp.getSelectedCollection();
const visible = [];
for (let i = 0; i < zp.itemsView.rowCount; i++) {
const item = zp.itemsView.getRow(i).ref;
if (item && item.isRegularItem()) visible.push(item);
}
console.log("visible", visible.length); // 78
console.log(
"direct",
c.getChildItems().filter(item => item.isRegularItem()).length
); // 78
const s = new Zotero.Search();
s.libraryID = c.libraryID;
s.addCondition("collection", "is", c.key);
s.addCondition("recursive", "true");
s.search().then(ids => {
const items = Zotero.Items.get(ids).filter(item => item && item.isRegularItem());
console.log("recursive", items.length); // 115
});
I also instrumented collection export and saw that during collection export Zotero explicitly traverses child collections and calls getChildItems() on them:
- parent
UDDNLLIG->78 - child
YQNWTYXV->24 - child
5AWL4F2D->62 - child
DJPD3VJM->6
By contrast, exporting selected visible items uses only the direct 78.
Conclusion
Zotero appears to distinguish direct vs recursive items correctly in the collection API and UI, but collection export is still using the recursive path.
If useful, I can provide exact console output and sample exported files.
Upgrade Storage