Based on lockstep's answer here, I wrote
\ifentrytype{book,collection,incollection}{%
}{%
\clearfield{url}%
\clearfield{urldate}%
\clearfield{review}%
\clearfield{series}%
}%
to suppress the URL and its date for the listed source types. The catch is, it even suppresses the URL for @ONLINE sources now, even if I only specify one entry type. Is the code above outdated or is it due to my settings?
Output
MWE, made after musicman's answer
\documentclass{article}
\usepackage[
style=authoryear-icomp
]{biblatex}
\AtEveryBibitem{%
\ifentrytype{book,collection,incollection}{
\clearfield{url}%
\clearfield{urldate}%
\clearfield{review}%
\clearfield{series}%%
}{}
}
\usepackage{filecontents}
\begin{filecontents}{test-lit.bib}
@book{Abook,
author = {AAAAbook, A.},
year = {2001},
title = {Alpha},
url = {tex.stackexchange.com},
}
@online{Bonline,
author = {BBBBonline, B.},
year = {2002},
title = {Bravo},
url = {tex.stackexchange.com},
}
@collection{Ccollection,
editor = {CCCCColletionEditor, C.},
year = {2002},
title = {Charlie},
url = {tex.stackexchange.com},
}
@incollection{Dincollection,
author = {DDDDincollection, D.},
year = {2002},
crossref = {Ccollection},
title = {Delta},
url = {tex.stackexchange.com},
}
\end{filecontents}
\addbibresource{test-lit.bib}
\nocite{*}
\listfiles
\begin{document}
Abc.
\printbibliography
\end{document}
if {} else {your commands}
- it's applicated only on entrytypes which are notbook,collection,incollection
, so @online of course, too.